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:
ee568b2
)
USB: usbtmc: fix stupid bug in open()
author
Greg Kroah-Hartman
<
[email protected]
>
Wed, 11 Mar 2009 03:42:55 +0000
(20:42 -0700)
committer
Greg Kroah-Hartman
<
[email protected]
>
Tue, 17 Mar 2009 21:01:28 +0000
(14:01 -0700)
open() will never succeed, as we always return -ENODEV. Fix this
obvious bug.
Thanks to Jouni Ryno for reporting it.
Reported-by: Jouni Ryno <
[email protected]
>
Cc: stable <
[email protected]
>
Signed-off-by: Greg Kroah-Hartman <
[email protected]
>
drivers/usb/class/usbtmc.c
patch
|
blob
|
history
diff --git
a/drivers/usb/class/usbtmc.c
b/drivers/usb/class/usbtmc.c
index 0f5c05f6f9df0fd022a1eebf5d49d8c2931a6c47..895a0983900121ccd19542670da41ae490aaa9b9 100644
(file)
--- a/
drivers/usb/class/usbtmc.c
+++ b/
drivers/usb/class/usbtmc.c
@@
-106,12
+106,13
@@
static int usbtmc_open(struct inode *inode, struct file *filp)
{
struct usb_interface *intf;
struct usbtmc_device_data *data;
- int retval =
-ENODEV
;
+ int retval =
0
;
intf = usb_find_interface(&usbtmc_driver, iminor(inode));
if (!intf) {
printk(KERN_ERR KBUILD_MODNAME
": can not find device for minor %d", iminor(inode));
+ retval = -ENODEV;
goto exit;
}