summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi/vtbl.c
diff options
context:
space:
mode:
authorBoris Brezillon <boris.brezillon@free-electrons.com>2016-09-16 16:59:18 +0200
committerRichard Weinberger <richard@nod.at>2016-10-02 22:48:14 +0200
commit91f4285fe389a2729efcd5db642d7652d8f27a40 (patch)
treeb2c5374b3457c9a8b955b3a63d3651e2cfb1736b /drivers/mtd/ubi/vtbl.c
parentfcbb6af17bda4b3856a1f4c302da5d0d7bf9a0f9 (diff)
downloadlinux-91f4285fe389a2729efcd5db642d7652d8f27a40.tar.bz2
UBI: provide helpers to allocate and free aeb elements
This not only hides the aeb allocation internals (which is always good in case we ever want to change the allocation system), but also helps us factorize the initialization of some common fields (ec and pnum). Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'drivers/mtd/ubi/vtbl.c')
-rw-r--r--drivers/mtd/ubi/vtbl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mtd/ubi/vtbl.c b/drivers/mtd/ubi/vtbl.c
index d85c19762160..9e1457708cbf 100644
--- a/drivers/mtd/ubi/vtbl.c
+++ b/drivers/mtd/ubi/vtbl.c
@@ -338,7 +338,7 @@ retry:
* of this LEB as it will be deleted and freed in 'ubi_add_to_av()'.
*/
err = ubi_add_to_av(ubi, ai, new_aeb->pnum, new_aeb->ec, vid_hdr, 0);
- kmem_cache_free(ai->aeb_slab_cache, new_aeb);
+ ubi_free_aeb(ai, new_aeb);
ubi_free_vid_hdr(ubi, vid_hdr);
return err;
@@ -351,7 +351,7 @@ write_error:
list_add(&new_aeb->u.list, &ai->erase);
goto retry;
}
- kmem_cache_free(ai->aeb_slab_cache, new_aeb);
+ ubi_free_aeb(ai, new_aeb);
out_free:
ubi_free_vid_hdr(ubi, vid_hdr);
return err;