commit | 137e92fd14959506269d58e08dae35c0bb745211 | [log] [tgz] |
---|---|---|
author | Wenwen Wang <wenwen@cs.uga.edu> | Sun Aug 18 11:36:44 2019 -0500 |
committer | Richard Weinberger <richard@nod.at> | Sun Sep 15 23:50:50 2019 +0200 |
tree | b6582b3f91d2159b229ad34898f99ca30a8494fe | |
parent | a3f12a35c91d649406c94fd791c8d6d1c3c29b6e [diff] |
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>