diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2009-03-11 04:42:55 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-03-17 22:01:28 +0100 |
commit | 5b10916ea0a62920204517e1c4ce14560b4f96ab (patch) | |
tree | c119039aa73e1b47e07b1857d6cfa2efc11adad6 /drivers/usb/class/usbtmc.c | |
parent | Avoid 64-bit "switch()" statements on 32-bit architectures (diff) | |
download | linux-5b10916ea0a62920204517e1c4ce14560b4f96ab.tar.xz linux-5b10916ea0a62920204517e1c4ce14560b4f96ab.zip |
USB: usbtmc: fix stupid bug in open()
open() will never succeed, as we always return -ENODEV. Fix this
obvious bug.
Thanks to Jouni Ryno for reporting it.
Reported-by: Jouni Ryno <Jouni.Ryno@fmi.fi>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/class/usbtmc.c')
-rw-r--r-- | drivers/usb/class/usbtmc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c index 0f5c05f6f9df..895a09839001 100644 --- 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; } |