Searched hist:"137 e92fd14959506269d58e08dae35c0bb745211" (Results 1 – 1 of 1) sorted by relevance
/linux/drivers/mtd/ |
H A D | sm_ftl.c | diff 137e92fd14959506269d58e08dae35c0bb745211 Sun Aug 18 18:36:44 CEST 2019 Wenwen Wang <wenwen@cs.uga.edu> 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>
|