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>
This commit is contained in:
Родитель
6c8c4e4c24
Коммит
114a6f8b52
|
@ -294,13 +294,13 @@ int st5481_setup_usb(struct st5481_adapter *adapter)
|
||||||
// Allocate URBs and buffers for interrupt endpoint
|
// Allocate URBs and buffers for interrupt endpoint
|
||||||
urb = usb_alloc_urb(0, GFP_KERNEL);
|
urb = usb_alloc_urb(0, GFP_KERNEL);
|
||||||
if (!urb) {
|
if (!urb) {
|
||||||
return -ENOMEM;
|
goto err1;
|
||||||
}
|
}
|
||||||
intr->urb = urb;
|
intr->urb = urb;
|
||||||
|
|
||||||
buf = kmalloc(INT_PKT_SIZE, GFP_KERNEL);
|
buf = kmalloc(INT_PKT_SIZE, GFP_KERNEL);
|
||||||
if (!buf) {
|
if (!buf) {
|
||||||
return -ENOMEM;
|
goto err2;
|
||||||
}
|
}
|
||||||
|
|
||||||
endpoint = &altsetting->endpoint[EP_INT-1];
|
endpoint = &altsetting->endpoint[EP_INT-1];
|
||||||
|
@ -313,6 +313,14 @@ int st5481_setup_usb(struct st5481_adapter *adapter)
|
||||||
endpoint->desc.bInterval);
|
endpoint->desc.bInterval);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
err2:
|
||||||
|
usb_free_urb(intr->urb);
|
||||||
|
intr->urb = NULL;
|
||||||
|
err1:
|
||||||
|
usb_free_urb(ctrl->urb);
|
||||||
|
ctrl->urb = NULL;
|
||||||
|
|
||||||
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Загрузка…
Ссылка в новой задаче