diff options
author | Bob Copeland <me@bobcopeland.com> | 2015-05-28 18:44:32 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-05-28 21:25:18 -0400 |
commit | 3a281f946640542a7a7372f436e101ee1fbc4c97 (patch) | |
tree | 9a7daf596ddab002528fac2fa2f5b5b4e9eb033f /fs | |
parent | dcbff39da3d815f08750552fdd04f96b51751129 (diff) |
omfs: set error return when d_make_root() fails
A static checker found the following issue in the error path for
omfs_fill_super:
fs/omfs/inode.c:552 omfs_fill_super()
warn: missing error code here? 'd_make_root()' failed. 'ret' = '0'
Fix by returning -ENOMEM in this case.
Signed-off-by: Bob Copeland <me@bobcopeland.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/omfs/inode.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/omfs/inode.c b/fs/omfs/inode.c index 70d4191cf33d..6ce542c11f98 100644 --- a/fs/omfs/inode.c +++ b/fs/omfs/inode.c | |||
@@ -549,8 +549,10 @@ static int omfs_fill_super(struct super_block *sb, void *data, int silent) | |||
549 | } | 549 | } |
550 | 550 | ||
551 | sb->s_root = d_make_root(root); | 551 | sb->s_root = d_make_root(root); |
552 | if (!sb->s_root) | 552 | if (!sb->s_root) { |
553 | ret = -ENOMEM; | ||
553 | goto out_brelse_bh2; | 554 | goto out_brelse_bh2; |
555 | } | ||
554 | printk(KERN_DEBUG "omfs: Mounted volume %s\n", omfs_rb->r_name); | 556 | printk(KERN_DEBUG "omfs: Mounted volume %s\n", omfs_rb->r_name); |
555 | 557 | ||
556 | ret = 0; | 558 | ret = 0; |