Commit 4d52ebc7 authored by Johan Hovold's avatar Johan Hovold Committed by David S. Miller

net: hso: bail out on interrupt URB allocation failure

Commit 31db0dbd ("net: hso: check for allocation failure in
hso_create_bulk_serial_device()") recently started returning an error
when the driver fails to allocate resources for the interrupt endpoint
and tiocmget functionality.

For consistency let's bail out from probe also if the URB allocation
fails.
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
Reviewed-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d5b3bd6a
...@@ -2635,14 +2635,14 @@ static struct hso_device *hso_create_bulk_serial_device( ...@@ -2635,14 +2635,14 @@ static struct hso_device *hso_create_bulk_serial_device(
} }
tiocmget->urb = usb_alloc_urb(0, GFP_KERNEL); tiocmget->urb = usb_alloc_urb(0, GFP_KERNEL);
if (tiocmget->urb) { if (!tiocmget->urb)
mutex_init(&tiocmget->mutex); goto exit;
init_waitqueue_head(&tiocmget->waitq);
} else mutex_init(&tiocmget->mutex);
hso_free_tiomget(serial); init_waitqueue_head(&tiocmget->waitq);
} } else {
else
num_urbs = 1; num_urbs = 1;
}
if (hso_serial_common_create(serial, num_urbs, BULK_URB_RX_SIZE, if (hso_serial_common_create(serial, num_urbs, BULK_URB_RX_SIZE,
BULK_URB_TX_SIZE)) BULK_URB_TX_SIZE))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment