public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] romfs: fix returm err while getting inode in fill_super
@ 2013-11-26  8:39 Rui Xiang
  2013-11-26  8:39 ` [PATCH 2/2] romfs: remove an redundant if condition in romfs_readpage Rui Xiang
  0 siblings, 1 reply; 4+ messages in thread
From: Rui Xiang @ 2013-11-26  8:39 UTC (permalink / raw)
  To: linux-kernel; +Cc: Rui Xiang

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



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-12-16  8:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-26  8:39 [PATCH 1/2] romfs: fix returm err while getting inode in fill_super Rui Xiang
2013-11-26  8:39 ` [PATCH 2/2] romfs: remove an redundant if condition in romfs_readpage Rui Xiang
2013-12-16  8:10   ` Andrew Morton
2013-12-16  8:24     ` Rui Xiang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox