diff options
Diffstat (limited to 'drivers/usb/core/hcd.c')
-rw-r--r-- | drivers/usb/core/hcd.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index 612fab6e54fb..79bdca5cb9c7 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c | |||
@@ -520,8 +520,10 @@ static int rh_call_control (struct usb_hcd *hcd, struct urb *urb) | |||
520 | */ | 520 | */ |
521 | tbuf_size = max_t(u16, sizeof(struct usb_hub_descriptor), wLength); | 521 | tbuf_size = max_t(u16, sizeof(struct usb_hub_descriptor), wLength); |
522 | tbuf = kzalloc(tbuf_size, GFP_KERNEL); | 522 | tbuf = kzalloc(tbuf_size, GFP_KERNEL); |
523 | if (!tbuf) | 523 | if (!tbuf) { |
524 | return -ENOMEM; | 524 | status = -ENOMEM; |
525 | goto err_alloc; | ||
526 | } | ||
525 | 527 | ||
526 | bufp = tbuf; | 528 | bufp = tbuf; |
527 | 529 | ||
@@ -734,6 +736,7 @@ error: | |||
734 | } | 736 | } |
735 | 737 | ||
736 | kfree(tbuf); | 738 | kfree(tbuf); |
739 | err_alloc: | ||
737 | 740 | ||
738 | /* any errors get returned through the urb completion */ | 741 | /* any errors get returned through the urb completion */ |
739 | spin_lock_irq(&hcd_root_hub_lock); | 742 | spin_lock_irq(&hcd_root_hub_lock); |