aboutsummaryrefslogtreecommitdiff
path: root/fs/ubifs
diff options
context:
space:
mode:
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>2013-06-07 10:17:22 +0800
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2013-10-26 11:11:59 +0100
commit7203db97b7378c2571797c13aa89327a2c487ea1 (patch)
treeb712c703825dbfb78d35773f95a837c819750cfe /fs/ubifs
parente71d1a59e757201454fd3cf66ddaceaf961bfb41 (diff)
UBIFS: fix return code
Fix to return -ENOMEM in the kmalloc() and d_make_root() error handling case instead of 0, as done elsewhere in those functions. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Diffstat (limited to 'fs/ubifs')
-rw-r--r--fs/ubifs/super.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
index 879b9976c12..01e1ad08d08 100644
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -1629,8 +1629,10 @@ static int ubifs_remount_rw(struct ubifs_info *c)
}
c->write_reserve_buf = kmalloc(COMPRESSED_DATA_NODE_BUF_SZ, GFP_KERNEL);
- if (!c->write_reserve_buf)
+ if (!c->write_reserve_buf) {
+ err = -ENOMEM;
goto out;
+ }
err = ubifs_lpt_init(c, 0, 1);
if (err)
@@ -2063,8 +2065,10 @@ static int ubifs_fill_super(struct super_block *sb, void *data, int silent)
}
sb->s_root = d_make_root(root);
- if (!sb->s_root)
+ if (!sb->s_root) {
+ err = -ENOMEM;
goto out_umount;
+ }
mutex_unlock(&c->umount_mutex);
return 0;