From: Inaky Perez-Gonzalez Date: Wed, 1 Aug 2007 03:34:03 +0000 (-0700) Subject: usb: usb_probe_interface() obeys authorization X-Git-Tag: v2.6.24-rc1~1395^2~110 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=72230abb21349cda54d6cce0d6fd325c023b958e;p=~emulex%2Finfiniband.git usb: usb_probe_interface() obeys authorization 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c index 63b1243a913..8da4801bb92 100644 --- a/drivers/usb/core/driver.c +++ b/drivers/usb/core/driver.c @@ -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);