netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa-dev-jBu1N2QxHDJrcw3mvpCnnVaTQe2KTcn/@public.gmane.org>
To: linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: Wolfram Sang
	<wsa-dev-jBu1N2QxHDJrcw3mvpCnnVaTQe2KTcn/@public.gmane.org>,
	Jan Dumon <j.dumon-x9gZzRpC1QbQT0dZR+AlfA@public.gmane.org>,
	netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCH 07/16] net: usb: hso: don't print error when allocating urb fails
Date: Thu, 11 Aug 2016 23:05:26 +0200	[thread overview]
Message-ID: <1470949539-25392-8-git-send-email-wsa-dev@sang-engineering.com> (raw)
In-Reply-To: <1470949539-25392-1-git-send-email-wsa-dev-jBu1N2QxHDJrcw3mvpCnnVaTQe2KTcn/@public.gmane.org>

kmalloc will print enough information in case of failure.

Signed-off-by: Wolfram Sang <wsa-dev-jBu1N2QxHDJrcw3mvpCnnVaTQe2KTcn/@public.gmane.org>
---
 drivers/net/usb/hso.c | 20 +++++---------------
 1 file changed, 5 insertions(+), 15 deletions(-)

diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c
index 4b4458616693f9..c5544d36c54f96 100644
--- a/drivers/net/usb/hso.c
+++ b/drivers/net/usb/hso.c
@@ -2300,10 +2300,8 @@ static int hso_serial_common_create(struct hso_serial *serial, int num_urbs,
 	serial->rx_data_length = rx_size;
 	for (i = 0; i < serial->num_rx_urbs; i++) {
 		serial->rx_urb[i] = usb_alloc_urb(0, GFP_KERNEL);
-		if (!serial->rx_urb[i]) {
-			dev_err(dev, "Could not allocate urb?\n");
+		if (!serial->rx_urb[i])
 			goto exit;
-		}
 		serial->rx_urb[i]->transfer_buffer = NULL;
 		serial->rx_urb[i]->transfer_buffer_length = 0;
 		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,
 
 	/* TX, allocate urb and initialize */
 	serial->tx_urb = usb_alloc_urb(0, GFP_KERNEL);
-	if (!serial->tx_urb) {
-		dev_err(dev, "Could not allocate urb?\n");
+	if (!serial->tx_urb)
 		goto exit;
-	}
 	serial->tx_urb->transfer_buffer = NULL;
 	serial->tx_urb->transfer_buffer_length = 0;
 	/* prepare our TX buffer */
@@ -2555,20 +2551,16 @@ static struct hso_device *hso_create_net_device(struct usb_interface *interface,
 	/* start allocating */
 	for (i = 0; i < MUX_BULK_RX_BUF_COUNT; i++) {
 		hso_net->mux_bulk_rx_urb_pool[i] = usb_alloc_urb(0, GFP_KERNEL);
-		if (!hso_net->mux_bulk_rx_urb_pool[i]) {
-			dev_err(&interface->dev, "Could not allocate rx urb\n");
+		if (!hso_net->mux_bulk_rx_urb_pool[i])
 			goto exit;
-		}
 		hso_net->mux_bulk_rx_buf_pool[i] = kzalloc(MUX_BULK_RX_BUF_SIZE,
 							   GFP_KERNEL);
 		if (!hso_net->mux_bulk_rx_buf_pool[i])
 			goto exit;
 	}
 	hso_net->mux_bulk_tx_urb = usb_alloc_urb(0, GFP_KERNEL);
-	if (!hso_net->mux_bulk_tx_urb) {
-		dev_err(&interface->dev, "Could not allocate tx urb\n");
+	if (!hso_net->mux_bulk_tx_urb)
 		goto exit;
-	}
 	hso_net->mux_bulk_tx_buf = kzalloc(MUX_BULK_TX_BUF_SIZE, GFP_KERNEL);
 	if (!hso_net->mux_bulk_tx_buf)
 		goto exit;
@@ -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);
-	if (!mux->shared_intr_urb) {
-		dev_err(&interface->dev, "Could not allocate intr urb?\n");
+	if (!mux->shared_intr_urb)
 		goto exit;
-	}
 	mux->shared_intr_buf =
 		kzalloc(le16_to_cpu(mux->intr_endp->wMaxPacketSize),
 			GFP_KERNEL);
-- 
2.8.1

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2016-08-11 21:05 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-11 21:05 [PATCH 00/16] net: don't print error when allocating urb fails Wolfram Sang
     [not found] ` <1470949539-25392-1-git-send-email-wsa-dev-jBu1N2QxHDJrcw3mvpCnnVaTQe2KTcn/@public.gmane.org>
2016-08-11 21:05   ` [PATCH 01/16] net: can: usb: ems_usb: " Wolfram Sang
2016-08-11 21:05   ` [PATCH 02/16] net: can: usb: esd_usb2: " Wolfram Sang
2016-08-11 21:05   ` [PATCH 03/16] net: can: usb: gs_usb: " Wolfram Sang
2016-08-11 21:05   ` [PATCH 04/16] net: can: usb: kvaser_usb: " Wolfram Sang
2016-08-11 21:05   ` [PATCH 05/16] net: can: usb: peak_usb: pcan_usb_core: " Wolfram Sang
2016-08-11 21:05   ` [PATCH 06/16] net: can: usb: usb_8dev: " Wolfram Sang
2016-08-11 21:05   ` Wolfram Sang [this message]
2016-08-11 21:05   ` [PATCH 08/16] net: usb: lan78xx: " Wolfram Sang
     [not found]     ` <1470949539-25392-9-git-send-email-wsa-dev-jBu1N2QxHDJrcw3mvpCnnVaTQe2KTcn/@public.gmane.org>
2016-08-11 21:42       ` Woojung.Huh-UWL1GkI3JZL3oGB3hsPCZA
2016-08-11 21:05   ` [PATCH 09/16] net: usb: usbnet: " Wolfram Sang
2016-08-11 21:05   ` [PATCH 10/16] net: wimax: i2400m: usb-notif: " Wolfram Sang
2016-08-11 21:05   ` [PATCH 11/16] net: wireless: ath: ar5523: ar5523: " Wolfram Sang
2016-08-11 21:05   ` [PATCH 12/16] net: wireless: broadcom: brcm80211: brcmfmac: usb: " Wolfram Sang
2016-08-13 21:55   ` [PATCH 00/16] net: " David Miller
2016-08-11 21:13 ` [PATCH 13/16] net: wireless: intersil: orinoco: orinoco_usb: " Wolfram Sang
2016-08-11 21:13   ` [PATCH 14/16] net: wireless: marvell: libertas_tf: if_usb: " Wolfram Sang
2016-08-11 21:13   ` [PATCH 15/16] net: wireless: marvell: mwifiex: usb: " Wolfram Sang
     [not found]   ` <1470949988-25705-1-git-send-email-wsa-dev-jBu1N2QxHDJrcw3mvpCnnVaTQe2KTcn/@public.gmane.org>
2016-08-11 21:13     ` [PATCH 16/16] net: wireless: realtek: rtlwifi: " Wolfram Sang
2016-08-11 21:35       ` Larry Finger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1470949539-25392-8-git-send-email-wsa-dev@sang-engineering.com \
    --to=wsa-dev-jbu1n2qxhdjrcw3mvpcnnvatqe2ktcn/@public.gmane.org \
    --cc=j.dumon-x9gZzRpC1QbQT0dZR+AlfA@public.gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).