[PATCH] debugfs: check return value correctly

From: Akinobu Mita
Date: Wed Oct 18 2006 - 23:24:25 EST


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

Cc: Greg Kroah-Hartman <gregkh@xxxxxxx>
Signed-off-by: Akinobu Mita <akinobu.mita@xxxxxxxxx>

Index: work-fault-inject/fs/debugfs/inode.c
===================================================================
--- work-fault-inject.orig/fs/debugfs/inode.c
+++ 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;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/