1 From 7233982ade15eeac05c6f351e8d347406e6bcd2f Mon Sep 17 00:00:00 2001
2 From: Wei Yongjun <weiyongjun1@huawei.com>
3 Date: Thu, 18 Jan 2018 14:05:05 +0000
4 Subject: mtd: ubi: wl: Fix error return code in ubi_wl_init()
6 From: Wei Yongjun <weiyongjun1@huawei.com>
8 commit 7233982ade15eeac05c6f351e8d347406e6bcd2f upstream.
10 Fix to return error code -ENOMEM from the kmem_cache_alloc() error
11 handling case instead of 0, as done elsewhere in this function.
13 Fixes: f78e5623f45b ("ubi: fastmap: Erase outdated anchor PEBs during
15 Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
16 Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
17 Signed-off-by: Richard Weinberger <richard@nod.at>
18 Cc: Ben Hutchings <ben.hutchings@codethink.co.uk>
19 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 drivers/mtd/ubi/wl.c | 8 ++++++--
23 1 file changed, 6 insertions(+), 2 deletions(-)
25 --- a/drivers/mtd/ubi/wl.c
26 +++ b/drivers/mtd/ubi/wl.c
27 @@ -1615,8 +1615,10 @@ int ubi_wl_init(struct ubi_device *ubi,
30 e = kmem_cache_alloc(ubi_wl_entry_slab, GFP_KERNEL);
39 @@ -1635,8 +1637,10 @@ int ubi_wl_init(struct ubi_device *ubi,
42 e = kmem_cache_alloc(ubi_wl_entry_slab, GFP_KERNEL);