Skip to content

Commit

Permalink
omfs: set error return when d_make_root() fails
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Bob Copeland authored and Linus Torvalds committed May 29, 2015
1 parent dcbff39 commit 3a281f9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/omfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -549,8 +549,10 @@ static int omfs_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) {
ret = -ENOMEM;
goto out_brelse_bh2;
}
printk(KERN_DEBUG "omfs: Mounted volume %s\n", omfs_rb->r_name);

ret = 0;
Expand Down

0 comments on commit 3a281f9

Please sign in to comment.