From: Bob Copeland Date: Thu, 28 May 2015 22:44:32 +0000 (-0700) Subject: omfs: set error return when d_make_root() fails X-Git-Tag: submit/tizen/20160607.132125~2397^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3a281f946640542a7a7372f436e101ee1fbc4c97;p=sdk%2Femulator%2Femulator-kernel.git 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 Reported-by: Dan Carpenter Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/omfs/inode.c b/fs/omfs/inode.c index 70d4191..6ce542c 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) } 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;