usb: usb_probe_interface() obeys authorization
authorInaky Perez-Gonzalez <inaky@linux.intel.com>
Wed, 1 Aug 2007 03:34:03 +0000 (20:34 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 12 Oct 2007 21:55:07 +0000 (14:55 -0700)
If called and the device is not authorized to be used, it won't
configure the interface and print a message saying so.

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/core/driver.c

index 63b1243a9139d7071a221255bdacde5e524b5996..8da4801bb92222cf6d6fa581db7c65640be5d6b0 100644 (file)
@@ -202,6 +202,11 @@ static int usb_probe_interface(struct device *dev)
        intf = to_usb_interface(dev);
        udev = interface_to_usbdev(intf);
 
+       if (udev->authorized == 0) {
+               dev_err(&intf->dev, "Device is not authorized for usage\n");
+               return -ENODEV;
+       }
+
        id = usb_match_id(intf, driver->id_table);
        if (!id)
                id = usb_match_dynamic_id(intf, driver);