efuse: fix KASAN bug [1/1]
authorZhongfu Luo <zhongfu.luo@amlogic.com>
Tue, 15 Oct 2019 05:49:33 +0000 (13:49 +0800)
committerZhongfu Luo <zhongfu.luo@amlogic.com>
Wed, 16 Oct 2019 09:35:22 +0000 (02:35 -0700)
PD#TV-11119

Problem:
BUG: KASAN: stack-out-of-bounds in
meson64_trustzone_efuse+0x168/0x268

Solution:
fix retcnt variable type

Verify:
tl1 skt

Change-Id: I54d9bb598277db539b68f2e741288348eb026e01
Signed-off-by: Zhongfu Luo <zhongfu.luo@amlogic.com>
drivers/amlogic/efuse/efuse_hw64.c

index f739590..98be948 100644 (file)
@@ -185,7 +185,7 @@ ssize_t _efuse_read(char *buf, size_t count, loff_t *ppos)
        unsigned int pos = *ppos;
 
        struct efuse_hal_api_arg arg;
-       unsigned int retcnt;
+       unsigned long retcnt;
        int ret;
 
        arg.cmd = EFUSE_HAL_API_READ;
@@ -208,7 +208,7 @@ ssize_t _efuse_write(const char *buf, size_t count, loff_t *ppos)
        unsigned int pos = *ppos;
 
        struct efuse_hal_api_arg arg;
-       unsigned int retcnt;
+       unsigned long retcnt;
        int ret;
 
        arg.cmd = EFUSE_HAL_API_WRITE;