From: fengsheng fengsheng5@huawei.com
driver inclusion category: Bugfix bugzilla: NA CVE: NA
1. fixup lbc_read8 and lbc_read8_nolock dont determine if the value is empty.
Signed-off-by: fengsheng fengsheng5@huawei.com Reviewed-by: zhangmu zhangmu1@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- drivers/soc/hisilicon/lbc/hs_lbc_pltfm.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/soc/hisilicon/lbc/hs_lbc_pltfm.c b/drivers/soc/hisilicon/lbc/hs_lbc_pltfm.c index 47f4c9fc5ade..2b3543bb5686 100644 --- a/drivers/soc/hisilicon/lbc/hs_lbc_pltfm.c +++ b/drivers/soc/hisilicon/lbc/hs_lbc_pltfm.c @@ -29,7 +29,7 @@
#include "hs_lbc_pltfm.h"
-#define LBC_DRIVER_VERSION "1.8.15.0" +#define LBC_DRIVER_VERSION "1.9.30.0"
struct hisi_lbc_dev g_lbc_dev = {0};
@@ -213,6 +213,11 @@ int lbc_read8(unsigned int index, unsigned int offset, unsigned char *value) return -EINVAL; }
+ if (!value) { + pr_err("value is null\n"); + return -EINVAL; + } + *value = (unsigned char)lbc_read(index, offset, LBC_RWDATA_WIDTH_8);
return 0; @@ -227,6 +232,11 @@ int lbc_read8_nolock(unsigned int index, unsigned int offset, unsigned char *val return -EINVAL; }
+ if (!value) { + pr_err("value is null\n"); + return -EINVAL; + } + *value = (unsigned char)lbc_read_unlock(index, offset, LBC_RWDATA_WIDTH_8); return 0; }