diff mbox

ext4: checking NULL instead of ERR_PTR

Message ID 20100826091619.GC20072@bicker
State Accepted, archived
Headers show

Commit Message

Dan Carpenter Aug. 26, 2010, 9:16 a.m. UTC
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>

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Theodore Y. Ts'o Dec. 30, 2010, 3:55 a.m. UTC | #1
On Thu, Aug 26, 2010 at 11:16:54AM +0200, Dan Carpenter wrote:
> 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>

Thanks, I've added this to the ext4 patch tree.

	     	   	       	    	  - Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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 "