debugfs: check return value correctly
The return value is stored in "*dentry", not in "dentry". Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
e45413eb70
commit
7bb0386f10
|
@ -147,13 +147,13 @@ static int debugfs_create_by_name(const char *name, mode_t mode,
|
||||||
*dentry = NULL;
|
*dentry = NULL;
|
||||||
mutex_lock(&parent->d_inode->i_mutex);
|
mutex_lock(&parent->d_inode->i_mutex);
|
||||||
*dentry = lookup_one_len(name, parent, strlen(name));
|
*dentry = lookup_one_len(name, parent, strlen(name));
|
||||||
if (!IS_ERR(dentry)) {
|
if (!IS_ERR(*dentry)) {
|
||||||
if ((mode & S_IFMT) == S_IFDIR)
|
if ((mode & S_IFMT) == S_IFDIR)
|
||||||
error = debugfs_mkdir(parent->d_inode, *dentry, mode);
|
error = debugfs_mkdir(parent->d_inode, *dentry, mode);
|
||||||
else
|
else
|
||||||
error = debugfs_create(parent->d_inode, *dentry, mode);
|
error = debugfs_create(parent->d_inode, *dentry, mode);
|
||||||
} else
|
} else
|
||||||
error = PTR_ERR(dentry);
|
error = PTR_ERR(*dentry);
|
||||||
mutex_unlock(&parent->d_inode->i_mutex);
|
mutex_unlock(&parent->d_inode->i_mutex);
|
||||||
|
|
||||||
return error;
|
return error;
|
||||||
|
|
Loading…
Reference in a new issue