diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2013-06-06 22:17:22 -0400 |
---|---|---|
committer | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2013-10-26 06:11:59 -0400 |
commit | 7203db97b7378c2571797c13aa89327a2c487ea1 (patch) | |
tree | b712c703825dbfb78d35773f95a837c819750cfe | |
parent | e71d1a59e757201454fd3cf66ddaceaf961bfb41 (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>
-rw-r--r-- | fs/ubifs/super.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c index 879b9976c12b..01e1ad08d08e 100644 --- a/fs/ubifs/super.c +++ b/fs/ubifs/super.c | |||
@@ -1629,8 +1629,10 @@ static int ubifs_remount_rw(struct ubifs_info *c) | |||
1629 | } | 1629 | } |
1630 | 1630 | ||
1631 | c->write_reserve_buf = kmalloc(COMPRESSED_DATA_NODE_BUF_SZ, GFP_KERNEL); | 1631 | c->write_reserve_buf = kmalloc(COMPRESSED_DATA_NODE_BUF_SZ, GFP_KERNEL); |
1632 | if (!c->write_reserve_buf) | 1632 | if (!c->write_reserve_buf) { |
1633 | err = -ENOMEM; | ||
1633 | goto out; | 1634 | goto out; |
1635 | } | ||
1634 | 1636 | ||
1635 | err = ubifs_lpt_init(c, 0, 1); | 1637 | err = ubifs_lpt_init(c, 0, 1); |
1636 | if (err) | 1638 | if (err) |
@@ -2063,8 +2065,10 @@ static int ubifs_fill_super(struct super_block *sb, void *data, int silent) | |||
2063 | } | 2065 | } |
2064 | 2066 | ||
2065 | sb->s_root = d_make_root(root); | 2067 | sb->s_root = d_make_root(root); |
2066 | if (!sb->s_root) | 2068 | if (!sb->s_root) { |
2069 | err = -ENOMEM; | ||
2067 | goto out_umount; | 2070 | goto out_umount; |
2071 | } | ||
2068 | 2072 | ||
2069 | mutex_unlock(&c->umount_mutex); | 2073 | mutex_unlock(&c->umount_mutex); |
2070 | return 0; | 2074 | return 0; |