USB: usbfs: fix -ENOENT error code to be -ENODEV
authorAlan Stern <stern@rowland.harvard.edu>
Thu, 30 Jul 2009 19:28:14 +0000 (15:28 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 7 Aug 2009 23:05:13 +0000 (16:05 -0700)
This patch (as1272) changes the error code returned when an open call
for a USB device node fails to locate the corresponding device.  The
appropriate error code is -ENODEV, not -ENOENT.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: Kay Sievers <kay.sievers@vrfy.org>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/core/devio.c

index e192fa05f8a1fdd7805235ff05e96b1bea70617c..4247eccf858c62c656cc58e91a40591eb3789786 100644 (file)
@@ -595,7 +595,7 @@ static int usbdev_open(struct inode *inode, struct file *file)
        if (!ps)
                goto out;
 
-       ret = -ENOENT;
+       ret = -ENODEV;
 
        /* usbdev device-node */
        if (imajor(inode) == USB_DEVICE_MAJOR)