summaryrefslogtreecommitdiff
path: root/lib/strncpy_from_user.c
diff options
context:
space:
mode:
authorWenwen Wang <wenwen@cs.uga.edu>2019-08-18 19:36:44 +0300
committerRichard Weinberger <richard@nod.at>2019-09-16 00:50:50 +0300
commit137e92fd14959506269d58e08dae35c0bb745211 (patch)
treeb6582b3f91d2159b229ad34898f99ca30a8494fe /lib/strncpy_from_user.c
parenta3f12a35c91d649406c94fd791c8d6d1c3c29b6e (diff)
downloadlinux-137e92fd14959506269d58e08dae35c0bb745211.tar.xz
mtd: sm_ftl: Fix memory leak in sm_init_zone() error path
In sm_init_zone(), 'zone->lba_to_phys_table' is allocated through kmalloc_array() and 'zone->free_sectors' is allocated in kfifo_alloc() respectively. However, they are not deallocated in the following execution if sm_read_sector() fails, leading to memory leaks. To fix this issue, free them before returning -EIO. Signed-off-by: Wenwen Wang <wenwen@cs.uga.edu> Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'lib/strncpy_from_user.c')
0 files changed, 0 insertions, 0 deletions