From inaky@linux.intel.com Thu Jul 19 19:08:20 2007 From: Inaky Perez-Gonzalez Date: Thu, 19 Jul 2007 19:07:08 -0700 Subject: [patch 05/17] usb: usb_set_configuration() obeys authorization To: greg@kroah.com Message-ID: <20070720020801.876609082@linux.intel.com>> Will refuse to configure a non-authorized device. Signed-off-by: Inaky Perez-Gonzalez Signed-off-by: Greg Kroah-Hartman --- drivers/usb/core/message.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c @@ -1457,6 +1457,9 @@ static struct usb_interface_assoc_descri * channels are available independently; and choosing between open * standard device protocols (like CDC) or proprietary ones. * + * Note that a non-authorized device (dev->authorized == 0) will only + * be put in unconfigured mode. + * * Note that USB has an additional level of device configurability, * associated with interfaces. That configurability is accessed using * usb_set_interface(). @@ -1478,6 +1481,8 @@ int usb_set_configuration(struct usb_dev struct usb_interface **new_interfaces = NULL; int n, nintf; + if (dev->authorized == 0) + configuration = -1; if (configuration == -1) configuration = 0; else {