From: Dan Carpenter <error27@gmail.com>
To: reiserfs-devel@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch] reiserfs: potential ERR_PTR dereference
Date: Sat, 15 Jan 2011 16:46:05 +0300 [thread overview]
Message-ID: <20110115134605.GB2721@bicker> (raw)
reiserfs_iget() returns an ERR_PTR on allocation failures. All the
other callers check for it so we should check here too.
Signed-off-by: Dan Carpenter <error27@gmail.com>
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
index 0aab04f..6949b98 100644
--- a/fs/reiserfs/super.c
+++ b/fs/reiserfs/super.c
@@ -237,7 +237,7 @@ static int finish_unfinished(struct super_block *s)
pathrelse(&path);
inode = reiserfs_iget(s, &obj_key);
- if (!inode) {
+ if (IS_ERR_OR_NULL(inode)) {
/* the unlink almost completed, it just did not manage to remove
"save" link and release objectid */
reiserfs_warning(s, "vs-2180", "iget failed for %K",
reply other threads:[~2011-01-15 13:46 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20110115134605.GB2721@bicker \
--to=error27@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=reiserfs-devel@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;
as well as URLs for NNTP newsgroup(s).