Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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;
	}