Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=16bbab2966309ae82cda3d378964c56096d4858c
Commit:     16bbab2966309ae82cda3d378964c56096d4858c
Parent:     d7d07255d3f5607802b0af29e11448d18e9ed558
Author:     Inaky Perez-Gonzalez <[EMAIL PROTECTED]>
AuthorDate: Tue Jul 31 20:34:01 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Fri Oct 12 14:55:06 2007 -0700

    usb: usb_set_configuration() obeys authorization
    
    Will refuse to configure a non-authorized device.
    
    Update: simplified if statement--thanks to Ragner Magalhaes for the
    heads up.
    
    Signed-off-by: Inaky Perez-Gonzalez <[EMAIL PROTECTED]>
    Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/core/message.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
index a26a729..025ac0b 100644
--- a/drivers/usb/core/message.c
+++ b/drivers/usb/core/message.c
@@ -1483,6 +1483,9 @@ static struct usb_interface_assoc_descriptor 
*find_iad(struct usb_device *dev,
  * 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().
@@ -1504,7 +1507,7 @@ int usb_set_configuration(struct usb_device *dev, int 
configuration)
        struct usb_interface **new_interfaces = NULL;
        int n, nintf;
 
-       if (configuration == -1)
+       if (dev->authorized == 0 || configuration == -1)
                configuration = 0;
        else {
                for (i = 0; i < dev->descriptor.bNumConfigurations; i++) {
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to