]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/usb/core/hcd.c
Merge 4.11-rc5 into usb-next
[linux.git] / drivers / usb / core / hcd.c
index 2342c1ffd900653a7ba2d0e27e8920a0c40a215f..da7ee5735c14e1e57ab33afc57f67bc98b0d27ad 100644 (file)
@@ -520,8 +520,10 @@ static int rh_call_control (struct usb_hcd *hcd, struct urb *urb)
         */
        tbuf_size =  max_t(u16, sizeof(struct usb_hub_descriptor), wLength);
        tbuf = kzalloc(tbuf_size, GFP_KERNEL);
-       if (!tbuf)
-               return -ENOMEM;
+       if (!tbuf) {
+               status = -ENOMEM;
+               goto err_alloc;
+       }
 
        bufp = tbuf;
 
@@ -734,6 +736,7 @@ static int rh_call_control (struct usb_hcd *hcd, struct urb *urb)
        }
 
        kfree(tbuf);
+ err_alloc:
 
        /* any errors get returned through the urb completion */
        spin_lock_irq(&hcd_root_hub_lock);