Skip to contentSkip to conversation

debugfs: check return value correctly

PATCH New Akinobu Mita 1 participant 1 message Oct 19, 2006 Driver core

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 debugfs: check return value correctly

The return value is stored in "*dentry", not in "dentry".

Cc Greg Kroah-Hartman <[email protected]>
fs/debugfs/inode.c +2 -2
Index: work-fault-inject/fs/debugfs/inode.c
===================================================================
@@ -147,13 +147,13 @@ static int debugfs_create_by_name(const 
 	*dentry = NULL;
 	mutex_lock(&parent->d_inode->i_mutex);
 	*dentry = lookup_one_len(name, parent, strlen(name));
-	if (!IS_ERR(dentry)) {
+	if (!IS_ERR(*dentry)) {
 		if ((mode & S_IFMT) == S_IFDIR)
 			error = debugfs_mkdir(parent->d_inode, *dentry, mode);
 		else 
 			error = debugfs_create(parent->d_inode, *dentry, mode);
 	} else
-		error = PTR_ERR(dentry);
+		error = PTR_ERR(*dentry);
 	mutex_unlock(&parent->d_inode->i_mutex);
 
 	return error;