Commit 12800ea9 authored by Wolfram Sang's avatar Wolfram Sang Committed by David S. Miller

net: usb: hso: don't print error when allocating urb fails

kmalloc will print enough information in case of failure.
Signed-off-by: default avatarWolfram Sang <wsa-dev@sang-engineering.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7fe7cfa4
...@@ -2300,10 +2300,8 @@ static int hso_serial_common_create(struct hso_serial *serial, int num_urbs, ...@@ -2300,10 +2300,8 @@ static int hso_serial_common_create(struct hso_serial *serial, int num_urbs,
serial->rx_data_length = rx_size; serial->rx_data_length = rx_size;
for (i = 0; i < serial->num_rx_urbs; i++) { for (i = 0; i < serial->num_rx_urbs; i++) {
serial->rx_urb[i] = usb_alloc_urb(0, GFP_KERNEL); serial->rx_urb[i] = usb_alloc_urb(0, GFP_KERNEL);
if (!serial->rx_urb[i]) { if (!serial->rx_urb[i])
dev_err(dev, "Could not allocate urb?\n");
goto exit; goto exit;
}
serial->rx_urb[i]->transfer_buffer = NULL; serial->rx_urb[i]->transfer_buffer = NULL;
serial->rx_urb[i]->transfer_buffer_length = 0; serial->rx_urb[i]->transfer_buffer_length = 0;
serial->rx_data[i] = kzalloc(serial->rx_data_length, serial->rx_data[i] = kzalloc(serial->rx_data_length,
...@@ -2314,10 +2312,8 @@ static int hso_serial_common_create(struct hso_serial *serial, int num_urbs, ...@@ -2314,10 +2312,8 @@ static int hso_serial_common_create(struct hso_serial *serial, int num_urbs,
/* TX, allocate urb and initialize */ /* TX, allocate urb and initialize */
serial->tx_urb = usb_alloc_urb(0, GFP_KERNEL); serial->tx_urb = usb_alloc_urb(0, GFP_KERNEL);
if (!serial->tx_urb) { if (!serial->tx_urb)
dev_err(dev, "Could not allocate urb?\n");
goto exit; goto exit;
}
serial->tx_urb->transfer_buffer = NULL; serial->tx_urb->transfer_buffer = NULL;
serial->tx_urb->transfer_buffer_length = 0; serial->tx_urb->transfer_buffer_length = 0;
/* prepare our TX buffer */ /* prepare our TX buffer */
...@@ -2555,20 +2551,16 @@ static struct hso_device *hso_create_net_device(struct usb_interface *interface, ...@@ -2555,20 +2551,16 @@ static struct hso_device *hso_create_net_device(struct usb_interface *interface,
/* start allocating */ /* start allocating */
for (i = 0; i < MUX_BULK_RX_BUF_COUNT; i++) { for (i = 0; i < MUX_BULK_RX_BUF_COUNT; i++) {
hso_net->mux_bulk_rx_urb_pool[i] = usb_alloc_urb(0, GFP_KERNEL); hso_net->mux_bulk_rx_urb_pool[i] = usb_alloc_urb(0, GFP_KERNEL);
if (!hso_net->mux_bulk_rx_urb_pool[i]) { if (!hso_net->mux_bulk_rx_urb_pool[i])
dev_err(&interface->dev, "Could not allocate rx urb\n");
goto exit; goto exit;
}
hso_net->mux_bulk_rx_buf_pool[i] = kzalloc(MUX_BULK_RX_BUF_SIZE, hso_net->mux_bulk_rx_buf_pool[i] = kzalloc(MUX_BULK_RX_BUF_SIZE,
GFP_KERNEL); GFP_KERNEL);
if (!hso_net->mux_bulk_rx_buf_pool[i]) if (!hso_net->mux_bulk_rx_buf_pool[i])
goto exit; goto exit;
} }
hso_net->mux_bulk_tx_urb = usb_alloc_urb(0, GFP_KERNEL); hso_net->mux_bulk_tx_urb = usb_alloc_urb(0, GFP_KERNEL);
if (!hso_net->mux_bulk_tx_urb) { if (!hso_net->mux_bulk_tx_urb)
dev_err(&interface->dev, "Could not allocate tx urb\n");
goto exit; goto exit;
}
hso_net->mux_bulk_tx_buf = kzalloc(MUX_BULK_TX_BUF_SIZE, GFP_KERNEL); hso_net->mux_bulk_tx_buf = kzalloc(MUX_BULK_TX_BUF_SIZE, GFP_KERNEL);
if (!hso_net->mux_bulk_tx_buf) if (!hso_net->mux_bulk_tx_buf)
goto exit; goto exit;
...@@ -2787,10 +2779,8 @@ struct hso_shared_int *hso_create_shared_int(struct usb_interface *interface) ...@@ -2787,10 +2779,8 @@ struct hso_shared_int *hso_create_shared_int(struct usb_interface *interface)
} }
mux->shared_intr_urb = usb_alloc_urb(0, GFP_KERNEL); mux->shared_intr_urb = usb_alloc_urb(0, GFP_KERNEL);
if (!mux->shared_intr_urb) { if (!mux->shared_intr_urb)
dev_err(&interface->dev, "Could not allocate intr urb?\n");
goto exit; goto exit;
}
mux->shared_intr_buf = mux->shared_intr_buf =
kzalloc(le16_to_cpu(mux->intr_endp->wMaxPacketSize), kzalloc(le16_to_cpu(mux->intr_endp->wMaxPacketSize),
GFP_KERNEL); GFP_KERNEL);
......
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