aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorInaky Perez-Gonzalez <inaky@linux.intel.com>2007-07-31 23:34:03 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-10-12 17:55:07 -0400
commit72230abb21349cda54d6cce0d6fd325c023b958e (patch)
treef3a6bfa3026d6c0f659343c40f81a6c46714ff52
parent1145065cd0434b0fd5cd7c0efe0f1438fb154ed0 (diff)
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 <inaky@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/usb/core/driver.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
index 63b1243a9139..8da4801bb922 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)
202 intf = to_usb_interface(dev); 202 intf = to_usb_interface(dev);
203 udev = interface_to_usbdev(intf); 203 udev = interface_to_usbdev(intf);
204 204
205 if (udev->authorized == 0) {
206 dev_err(&intf->dev, "Device is not authorized for usage\n");
207 return -ENODEV;
208 }
209
205 id = usb_match_id(intf, driver->id_table); 210 id = usb_match_id(intf, driver->id_table);
206 if (!id) 211 if (!id)
207 id = usb_match_dynamic_id(intf, driver); 212 id = usb_match_dynamic_id(intf, driver);