diff options
author | Boris Brezillon <boris.brezillon@free-electrons.com> | 2016-09-16 16:59:18 +0200 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2016-10-02 22:48:14 +0200 |
commit | 91f4285fe389a2729efcd5db642d7652d8f27a40 (patch) | |
tree | b2c5374b3457c9a8b955b3a63d3651e2cfb1736b /drivers/mtd/ubi/vtbl.c | |
parent | UBI: fastmap: use ubi_io_{read, write}_data() instead of ubi_io_{read, write}() (diff) | |
download | linux-91f4285fe389a2729efcd5db642d7652d8f27a40.tar.xz linux-91f4285fe389a2729efcd5db642d7652d8f27a40.zip |
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 '')
-rw-r--r-- | drivers/mtd/ubi/vtbl.c | 4 |
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; |