Skip to content

Commit

Permalink
debugfs: check return value correctly
Browse files Browse the repository at this point in the history
The return value is stored in "*dentry", not in "dentry".

Signed-off-by: Akinobu Mita <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
mita authored and gregkh committed Nov 16, 2006
1 parent e45413e commit 7bb0386
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/debugfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,13 @@ static int debugfs_create_by_name(const char *name, mode_t mode,
*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;
Expand Down

0 comments on commit 7bb0386

Please sign in to comment.