staging: ozwpan: Check for correct config number.
authorRupesh Gujare <rupesh.gujare@atmel.com>
Fri, 23 Aug 2013 17:33:28 +0000 (18:33 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 26 Aug 2013 13:27:42 +0000 (06:27 -0700)
Check for valid config number before completing set interface.

Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ozwpan/ozhcd.c

index ab93b74..83ed64c 100644 (file)
@@ -909,7 +909,7 @@ static void oz_hcd_complete_set_interface(struct oz_port *port, struct urb *urb,
        struct usb_hcd *hcd = port->ozhcd->hcd;
        int rc = 0;
 
-       if (rcode == 0) {
+       if ((rcode == 0) && (port->config_num > 0)) {
                struct usb_host_config *config;
                struct usb_host_interface *intf;
                oz_dbg(ON, "Set interface %d alt %d\n", if_num, alt);