Skip to contentSkip to conversation

ext4: checking NULL instead of ERR_PTR

PATCH In review Dan Carpenter 2 participants 2 messages Aug 26, 2010 – Dec 30, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ext4: checking NULL instead of ERR_PTR

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().

fs/ext4/super.c +1 -1
index 2614774..efaa27e 100644
@@ -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 "
maintainer
#1 lore raw
Quoted 4 lines · Dan Carpenter

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().

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

- Ted