Skip to content

Commit

Permalink
net: hso: bail out on interrupt URB allocation failure
Browse files Browse the repository at this point in the history
commit 4d52ebc upstream.

Commit 31db0db ("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: Johan Hovold <johan@kernel.org>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Johan Hovold authored and Greg Kroah-Hartman committed Jun 3, 2021
1 parent 0e3045c commit c1febac
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions drivers/net/usb/hso.c
Original file line number Diff line number Diff line change
Expand Up @@ -2635,14 +2635,14 @@ static struct hso_device *hso_create_bulk_serial_device(
}

tiocmget->urb = usb_alloc_urb(0, GFP_KERNEL);
if (tiocmget->urb) {
mutex_init(&tiocmget->mutex);
init_waitqueue_head(&tiocmget->waitq);
} else
hso_free_tiomget(serial);
}
else
if (!tiocmget->urb)
goto exit;

mutex_init(&tiocmget->mutex);
init_waitqueue_head(&tiocmget->waitq);
} else {
num_urbs = 1;
}

if (hso_serial_common_create(serial, num_urbs, BULK_URB_RX_SIZE,
BULK_URB_TX_SIZE))
Expand Down

0 comments on commit c1febac

Please sign in to comment.