diff options
author | Marina Makienko <makienko@ispras.ru> | 2013-02-25 17:26:50 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-02-26 17:33:56 -0500 |
commit | 114a6f8b52163c0232fbcd7f3808ff04dc61a9b5 (patch) | |
tree | 43e58fd3d355599e7b9fd1612eea0b1ab55e3d9c /drivers/isdn | |
parent | 6c8c4e4c24b9f6cee3d356a51e4a7f2af787a49b (diff) |
isdn: hisax: add missing usb_free_urb
Add missing usb_free_urb() on failure path in st5481_setup_usb().
Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Marina Makienko <makienko@ispras.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/isdn')
-rw-r--r-- | drivers/isdn/hisax/st5481_usb.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/isdn/hisax/st5481_usb.c b/drivers/isdn/hisax/st5481_usb.c index 017c67ea3f4c..ead0a4fb7448 100644 --- a/drivers/isdn/hisax/st5481_usb.c +++ b/drivers/isdn/hisax/st5481_usb.c | |||
@@ -294,13 +294,13 @@ int st5481_setup_usb(struct st5481_adapter *adapter) | |||
294 | // Allocate URBs and buffers for interrupt endpoint | 294 | // Allocate URBs and buffers for interrupt endpoint |
295 | urb = usb_alloc_urb(0, GFP_KERNEL); | 295 | urb = usb_alloc_urb(0, GFP_KERNEL); |
296 | if (!urb) { | 296 | if (!urb) { |
297 | return -ENOMEM; | 297 | goto err1; |
298 | } | 298 | } |
299 | intr->urb = urb; | 299 | intr->urb = urb; |
300 | 300 | ||
301 | buf = kmalloc(INT_PKT_SIZE, GFP_KERNEL); | 301 | buf = kmalloc(INT_PKT_SIZE, GFP_KERNEL); |
302 | if (!buf) { | 302 | if (!buf) { |
303 | return -ENOMEM; | 303 | goto err2; |
304 | } | 304 | } |
305 | 305 | ||
306 | endpoint = &altsetting->endpoint[EP_INT-1]; | 306 | endpoint = &altsetting->endpoint[EP_INT-1]; |
@@ -313,6 +313,14 @@ int st5481_setup_usb(struct st5481_adapter *adapter) | |||
313 | endpoint->desc.bInterval); | 313 | endpoint->desc.bInterval); |
314 | 314 | ||
315 | return 0; | 315 | return 0; |
316 | err2: | ||
317 | usb_free_urb(intr->urb); | ||
318 | intr->urb = NULL; | ||
319 | err1: | ||
320 | usb_free_urb(ctrl->urb); | ||
321 | ctrl->urb = NULL; | ||
322 | |||
323 | return -ENOMEM; | ||
316 | } | 324 | } |
317 | 325 | ||
318 | /* | 326 | /* |