diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2009-03-10 20:42:55 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-03-23 14:55:29 -0700 |
commit | df17d7bed92939eb7e1c9966e8622e21ad27e2dc (patch) | |
tree | 6387969288169cba80c988f471779611c72c07cf /drivers | |
parent | 4acd0aa935389d5122aa6b9b325a9ac37d417f60 (diff) |
USB: usbtmc: fix stupid bug in open()
commit 5b10916ea0a62920204517e1c4ce14560b4f96ab upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-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 43a863c5cc43..a32ddecb95df 100644 --- a/drivers/usb/class/usbtmc.c +++ b/drivers/usb/class/usbtmc.c @@ -105,12 +105,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; } |