From: Greg Kroah-Hartman Date: Wed, 11 Mar 2009 03:42:55 +0000 (-0700) Subject: USB: usbtmc: fix stupid bug in open() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5b10916ea0a62920204517e1c4ce14560b4f96ab;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git 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 Cc: stable Signed-off-by: Greg Kroah-Hartman --- 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; }