Commit 5b10916e authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

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: default avatarJouni Ryno <Jouni.Ryno@fmi.fi>
Cc: stable <stable@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent ee568b25
...@@ -106,12 +106,13 @@ static int usbtmc_open(struct inode *inode, struct file *filp) ...@@ -106,12 +106,13 @@ static int usbtmc_open(struct inode *inode, struct file *filp)
{ {
struct usb_interface *intf; struct usb_interface *intf;
struct usbtmc_device_data *data; struct usbtmc_device_data *data;
int retval = -ENODEV; int retval = 0;
intf = usb_find_interface(&usbtmc_driver, iminor(inode)); intf = usb_find_interface(&usbtmc_driver, iminor(inode));
if (!intf) { if (!intf) {
printk(KERN_ERR KBUILD_MODNAME printk(KERN_ERR KBUILD_MODNAME
": can not find device for minor %d", iminor(inode)); ": can not find device for minor %d", iminor(inode));
retval = -ENODEV;
goto exit; goto exit;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment