提交 af7bcee2 编写于 作者: P Pan Bian 提交者: Richard Weinberger

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: NPan Bian <bianpan2016@163.com>
Reviewed-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: NRichard Weinberger <richard@nod.at>
上级 a51a0c8d
...@@ -1063,7 +1063,7 @@ int ubi_scan_fastmap(struct ubi_device *ubi, struct ubi_attach_info *ai, ...@@ -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); e = kmem_cache_alloc(ubi_wl_entry_slab, GFP_KERNEL);
if (!e) { if (!e) {
while (i--) while (i--)
kfree(fm->e[i]); kmem_cache_free(ubi_wl_entry_slab, fm->e[i]);
ret = -ENOMEM; ret = -ENOMEM;
goto free_hdr; goto free_hdr;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册