summaryrefslogtreecommitdiff
path: root/drivers/mtd/ubi
diff options
context:
space:
mode:
authorPan Bian <bianpan2016@163.com>2017-10-29 15:40:02 +0300
committerRichard Weinberger <richard@nod.at>2018-01-17 23:48:02 +0300
commitaf7bcee27652bbf2502207500ad200763707a160 (patch)
tree81f452fe45c80f9fda5b74ece6aff70d33e2700f /drivers/mtd/ubi
parenta51a0c8d213594bc094cb8e54aad0cb6d7f7b9a6 (diff)
downloadlinux-af7bcee27652bbf2502207500ad200763707a160.tar.xz
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.c2
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;