lkml.org 
[lkml]   [2013]   [Nov]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/2] romfs: fix returm err while getting inode in fill_super
Date
Getting an inode by romfs_iget may lead to an err in fill_super,
and the err value should be return.

And it should return -ENOMEM instead while d_make_root fails,
fix it too.

Signed-off-by: Rui Xiang <rui.xiang@huawei.com>
---
fs/romfs/super.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/fs/romfs/super.c b/fs/romfs/super.c
index ff1d3d4..d841878 100644
--- a/fs/romfs/super.c
+++ b/fs/romfs/super.c
@@ -533,16 +533,14 @@ static int romfs_fill_super(struct super_block *sb, void *data, int silent)

root = romfs_iget(sb, pos);
if (IS_ERR(root))
- goto error;
+ return PTR_ERR(root);

sb->s_root = d_make_root(root);
if (!sb->s_root)
- goto error;
+ return -ENOMEM;

return 0;

-error:
- return -EINVAL;
error_rsb_inval:
ret = -EINVAL;
error_rsb:
--
1.8.2.2



\
 
 \ /
  Last update: 2013-11-26 10:01    [W:0.045 / U:2.284 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site