diff options
author | Pan Bian <bianpan2016@163.com> | 2017-10-29 20:40:02 +0800 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2018-01-17 21:48:02 +0100 |
commit | af7bcee27652bbf2502207500ad200763707a160 (patch) | |
tree | 81f452fe45c80f9fda5b74ece6aff70d33e2700f /drivers/mtd/ubi | |
parent | a51a0c8d213594bc094cb8e54aad0cb6d7f7b9a6 (diff) | |
download | linux-af7bcee27652bbf2502207500ad200763707a160.tar.gz linux-af7bcee27652bbf2502207500ad200763707a160.tar.bz2 linux-af7bcee27652bbf2502207500ad200763707a160.zip |
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>
Diffstat (limited to 'drivers/mtd/ubi')
-rw-r--r-- | drivers/mtd/ubi/fastmap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/ubi/fastmap.c b/drivers/mtd/ubi/fastmap.c index 5a832bc79b1b..717db749808a 100644 --- a/drivers/mtd/ubi/fastmap.c +++ b/drivers/mtd/ubi/fastmap.c @@ -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; |