From: Dan Carpenter <error27@gmail.com>
To: Theodore Ts'o <tytso@mit.edu>
Cc: Andreas Dilger <adilger.kernel@dilger.ca>,
Jan Kara <jack@suse.cz>, Christoph Hellwig <hch@lst.de>,
Eric Sandeen <sandeen@redhat.com>,
Dmitry Monakhov <dmonakhov@openvz.org>,
linux-ext4@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch] ext4: checking NULL instead of ERR_PTR
Date: Thu, 26 Aug 2010 11:16:54 +0200 [thread overview]
Message-ID: <20100826091619.GC20072@bicker> (raw)
d_path() returns an ERR_PTR and it doesn't return NULL. This is in
ext4_error_file() and no one actually calls ext4_error_file().
Signed-off-by: Dan Carpenter <error27@gmail.com>
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 2614774..efaa27e 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -429,7 +429,7 @@ void ext4_error_file(struct file *file, const char *function,
save_error_info(inode->i_sb, function, line);
va_start(args, fmt);
path = d_path(&(file->f_path), pathname, sizeof(pathname));
- if (!path)
+ if (IS_ERR(path))
path = "(unknown)";
printk(KERN_CRIT
"EXT4-fs error (device %s): %s:%d: inode #%lu "
next reply other threads:[~2010-08-26 9:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-26 9:16 Dan Carpenter [this message]
2010-12-30 3:55 ` [patch] ext4: checking NULL instead of ERR_PTR Ted Ts'o
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=20100826091619.GC20072@bicker \
--to=error27@gmail.com \
--cc=adilger.kernel@dilger.ca \
--cc=dmonakhov@openvz.org \
--cc=hch@lst.de \
--cc=jack@suse.cz \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=sandeen@redhat.com \
--cc=tytso@mit.edu \
/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).