mirror of
https://github.com/torvalds/linux.git
synced 2024-12-04 18:13:04 +00:00
ubi: fastmap: Use kmem_cache_free to deallocate memory
Memory allocated by kmem_cache_alloc() should not be deallocated with kfree(). Use kmem_cache_free() instead. Signed-off-by: Pan Bian <bianpan2016@163.com> Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: Richard Weinberger <richard@nod.at>
This commit is contained in:
parent
a51a0c8d21
commit
af7bcee276
@ -1063,7 +1063,7 @@ int ubi_scan_fastmap(struct ubi_device *ubi, struct ubi_attach_info *ai,
|
||||
e = kmem_cache_alloc(ubi_wl_entry_slab, GFP_KERNEL);
|
||||
if (!e) {
|
||||
while (i--)
|
||||
kfree(fm->e[i]);
|
||||
kmem_cache_free(ubi_wl_entry_slab, fm->e[i]);
|
||||
|
||||
ret = -ENOMEM;
|
||||
goto free_hdr;
|
||||
|
Loading…
Reference in New Issue
Block a user