mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rui Xiang <rui.xiang@huawei.com>
To: <linux-kernel@vger.kernel.org>
Cc: Rui Xiang <rui.xiang@huawei.com>
Subject: [PATCH 1/2] romfs: fix returm err while getting inode in fill_super
Date: Tue, 26 Nov 2013 16:39:08 +0800	[thread overview]
Message-ID: <1385455149-20752-1-git-send-email-rui.xiang@huawei.com> (raw)

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



             reply	other threads:[~2013-11-26  8:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-26  8:39 Rui Xiang [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1385455149-20752-1-git-send-email-rui.xiang@huawei.com \
    --to=rui.xiang@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®