diff options
author | Dan Carpenter <error27@gmail.com> | 2010-04-22 06:00:52 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-04-30 12:25:09 -0400 |
commit | fa7fe7af146a7b613e36a311eefbbfb5555325d1 (patch) | |
tree | 354dc1cf91089c473d9e236518d97cf84adb1bf7 /drivers/usb | |
parent | 1d0f11b39728099100a768cab2d7a90389017e75 (diff) |
USB: fix testing the wrong variable in fs_create_by_name()
There is a typo here. We should be testing "*dentry" which was just
assigned instead of "dentry". This could result in dereferencing an
ERR_PTR inside either usbfs_mkdir() or usbfs_create().
Signed-off-by: Dan Carpenter <error27@gmail.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/core/inode.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/core/inode.c b/drivers/usb/core/inode.c index 97b40ce133f0..4a6366a42129 100644 --- a/drivers/usb/core/inode.c +++ b/drivers/usb/core/inode.c | |||
@@ -515,13 +515,13 @@ static int fs_create_by_name (const char *name, mode_t mode, | |||
515 | *dentry = NULL; | 515 | *dentry = NULL; |
516 | mutex_lock(&parent->d_inode->i_mutex); | 516 | mutex_lock(&parent->d_inode->i_mutex); |
517 | *dentry = lookup_one_len(name, parent, strlen(name)); | 517 | *dentry = lookup_one_len(name, parent, strlen(name)); |
518 | if (!IS_ERR(dentry)) { | 518 | if (!IS_ERR(*dentry)) { |
519 | if ((mode & S_IFMT) == S_IFDIR) | 519 | if ((mode & S_IFMT) == S_IFDIR) |
520 | error = usbfs_mkdir (parent->d_inode, *dentry, mode); | 520 | error = usbfs_mkdir (parent->d_inode, *dentry, mode); |
521 | else | 521 | else |
522 | error = usbfs_create (parent->d_inode, *dentry, mode); | 522 | error = usbfs_create (parent->d_inode, *dentry, mode); |
523 | } else | 523 | } else |
524 | error = PTR_ERR(dentry); | 524 | error = PTR_ERR(*dentry); |
525 | mutex_unlock(&parent->d_inode->i_mutex); | 525 | mutex_unlock(&parent->d_inode->i_mutex); |
526 | 526 | ||
527 | return error; | 527 | return error; |