Skip to content
Commit 137e92fd authored by Wenwen Wang's avatar Wenwen Wang Committed by Richard Weinberger
Browse files

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: default avatarWenwen Wang <wenwen@cs.uga.edu>
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
parent a3f12a35
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment