[PATCH -next] UBI: fix error return code in ubi_init()

2013-05-17 Thread Wei Yongjun
From: Wei Yongjun 

Fix to return -ENOMEM in the kmem_cache_create() error handling
case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun 
---
 drivers/mtd/ubi/build.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c
index 8ff08ec..a444d04 100644
--- a/drivers/mtd/ubi/build.c
+++ b/drivers/mtd/ubi/build.c
@@ -1243,8 +1243,10 @@ static int __init ubi_init(void)
ubi_wl_entry_slab = kmem_cache_create("ubi_wl_entry_slab",
  sizeof(struct ubi_wl_entry),
  0, 0, NULL);
-   if (!ubi_wl_entry_slab)
+   if (!ubi_wl_entry_slab) {
+   err = -ENOMEM;
goto out_dev_unreg;
+   }
 
err = ubi_debugfs_init();
if (err)

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH -next] UBI: fix error return code in ubi_init()

2013-05-17 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn

Fix to return -ENOMEM in the kmem_cache_create() error handling
case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn
---
 drivers/mtd/ubi/build.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c
index 8ff08ec..a444d04 100644
--- a/drivers/mtd/ubi/build.c
+++ b/drivers/mtd/ubi/build.c
@@ -1243,8 +1243,10 @@ static int __init ubi_init(void)
ubi_wl_entry_slab = kmem_cache_create(ubi_wl_entry_slab,
  sizeof(struct ubi_wl_entry),
  0, 0, NULL);
-   if (!ubi_wl_entry_slab)
+   if (!ubi_wl_entry_slab) {
+   err = -ENOMEM;
goto out_dev_unreg;
+   }
 
err = ubi_debugfs_init();
if (err)

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/