projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1d0f11b
)
USB: fix testing the wrong variable in fs_create_by_name()
author
Dan Carpenter
<
[email protected]
>
Thu, 22 Apr 2010 10:00:52 +0000
(12:00 +0200)
committer
Greg Kroah-Hartman
<
[email protected]
>
Fri, 30 Apr 2010 16:25:09 +0000
(09:25 -0700)
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 <
[email protected]
>
Cc: stable <
[email protected]
>
Signed-off-by: Greg Kroah-Hartman <
[email protected]
>
drivers/usb/core/inode.c
patch
|
blob
|
history
diff --git
a/drivers/usb/core/inode.c
b/drivers/usb/core/inode.c
index 97b40ce133f0a8b7165a742d885dd91656843bc1..4a6366a42129196a112216771f727eca8b643da4 100644
(file)
--- 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,
*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 = usbfs_mkdir (parent->d_inode, *dentry, mode);
else
error = usbfs_create (parent->d_inode, *dentry, mode);
} else
- error = PTR_ERR(dentry);
+ error = PTR_ERR(
*
dentry);
mutex_unlock(&parent->d_inode->i_mutex);
return error;