net: don't print error when allocating urb fails
Subsystems (13)
cover net: don't print error when allocating urb fails
This per-subsystem series is part of a tree wide cleanup. usb_alloc_urb() uses kmalloc which already prints enough information on failure. So, let's simply remove those "allocation failed" messages from drivers like we did already for other -ENOMEM cases. gkh acked this approach when we talked about it at LCJ in Tokyo a few weeks ago.
Wolfram Sang (16):
net: can: usb: ems_usb: don't print error when allocating urb fails
net: can: usb: esd_usb2: don't print error when allocating urb fails
net: can: usb: gs_usb: don't print error when allocating urb fails
net: can: usb: kvaser_usb: don't print error when allocating urb fails
net: can: usb: peak_usb: pcan_usb_core: don't print error when
allocating urb fails
net: can: usb: usb_8dev: don't print error when allocating urb fails
net: usb: hso: don't print error when allocating urb fails
net: usb: lan78xx: don't print error when allocating urb fails
net: usb: usbnet: don't print error when allocating urb fails
net: wimax: i2400m: usb-notif: don't print error when allocating urb
fails
net: wireless: ath: ar5523: ar5523: don't print error when allocating
urb fails
net: wireless: broadcom: brcm80211: brcmfmac: usb: don't print error
when allocating urb fails
net: wireless: intersil: orinoco: orinoco_usb: don't print error when
allocating urb fails
net: wireless: marvell: libertas_tf: if_usb: don't print error when
allocating urb fails
net: wireless: marvell: mwifiex: usb: don't print error when
allocating urb fails
net: wireless: realtek: rtlwifi: usb: don't print error when
allocating urb fails
drivers/net/can/usb/ems_usb.c | 9 ++------- drivers/net/can/usb/esd_usb2.c | 3 --- drivers/net/can/usb/gs_usb.c | 9 ++------- drivers/net/can/usb/kvaser_usb.c | 7 +------ drivers/net/can/usb/peak_usb/pcan_usb_core.c | 6 +----- drivers/net/can/usb/usb_8dev.c | 5 +---- drivers/net/usb/hso.c | 20 +++++--------------- drivers/net/usb/lan78xx.c | 4 +--- drivers/net/usb/usbnet.c | 5 +---- drivers/net/wimax/i2400m/usb-notif.c | 1 - drivers/net/wireless/ath/ar5523/ar5523.c | 9 ++------- .../net/wireless/broadcom/brcm80211/brcmfmac/usb.c | 8 ++------ drivers/net/wireless/intersil/orinoco/orinoco_usb.c | 4 +--- drivers/net/wireless/marvell/libertas_tf/if_usb.c | 12 +++--------- drivers/net/wireless/marvell/mwifiex/usb.c | 19 ++++--------------- drivers/net/wireless/realtek/rtlwifi/usb.c | 8 +------- 16 files changed, 27 insertions(+), 102 deletions(-)
Signature · 6 lines
2.8.1 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1470949539-25392-1-git-send-email-wsa-dev-jBu1N2QxHDJrcw3mvpCnnVaTQe2KTcn/@public.gmane.org
PATCH 1/16 net: can: usb: ems_usb: don't print error when allocating urb fails
kmalloc will print enough information in case of failure.
--- drivers/net/can/usb/ems_usb.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
drivers/net/can/usb/ems_usb.c +2 -7
@@ -600,7 +600,6 @@ static int ems_usb_start(struct ems_usb *dev)/* create a URB, and a buffer for it */ urb =usb_alloc_urb (0 ,GFP_KERNEL );if (!urb) { -netdev_err (netdev,"No memory left for URBs\n" ); err = -ENOMEM ;break ; }
@@ -752,10 +751,8 @@ static netdev_tx_t ems_usb_start_xmit(struct sk_buff *skb, struct net_device *ne/* create a URB, and a buffer for it, and copy the data to the URB */ urb =usb_alloc_urb (0 ,GFP_ATOMIC ); -if (!urb) { -netdev_err (netdev,"No memory left for URBs\n" ); +if (!urb) goto nomem; - } buf =usb_alloc_coherent (dev->udev, size,GFP_ATOMIC , &urb->transfer_dma);if (!buf) {
@@ -1007,10 +1004,8 @@ static int ems_usb_probe(struct usb_interface *intf, dev->tx_contexts[i].echo_index =MAX_TX_URBS ; dev->intr_urb =usb_alloc_urb (0 ,GFP_KERNEL ); -if (!dev->intr_urb) { -dev_err (&intf->dev,"Couldn't alloc intr URB\n" ); +if (!dev->intr_urb) goto cleanup_candev; - } dev->intr_in_buffer =kzalloc (INTR_IN_BUFFER_SIZE ,GFP_KERNEL );if (!dev->intr_in_buffer)
Signature · 6 lines
2.8.1 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 2/16 net: can: usb: esd_usb2: don't print error when allocating urb fails
In reply to a message not in the archivekmalloc will print enough information in case of failure.
--- drivers/net/can/usb/esd_usb2.c | 3 --- 1 file changed, 3 deletions(-)
drivers/net/can/usb/esd_usb2.c +0 -3
@@ -558,8 +558,6 @@ static int esd_usb2_setup_rx_urbs(struct esd_usb2 *dev)/* create a URB, and a buffer for it */ urb =usb_alloc_urb (0 ,GFP_KERNEL );if (!urb) { -dev_warn (dev->udev->dev.parent, -"No memory left for URBs\n" ); err = -ENOMEM ;break ; }
@@ -730,7 +728,6 @@ static netdev_tx_t esd_usb2_start_xmit(struct sk_buff *skb,/* create a URB, and a buffer for it, and copy the data to the URB */ urb =usb_alloc_urb (0 ,GFP_ATOMIC );if (!urb) { -netdev_err (netdev,"No memory left for URBs\n" ); stats->tx_dropped++;dev_kfree_skb (skb); goto nourbmem;
Signature · 6 lines
2.8.1 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 3/16 net: can: usb: gs_usb: don't print error when allocating urb fails
In reply to a message not in the archivekmalloc will print enough information in case of failure.
--- drivers/net/can/usb/gs_usb.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
drivers/net/can/usb/gs_usb.c +2 -7
@@ -493,10 +493,8 @@ static netdev_tx_t gs_can_start_xmit(struct sk_buff *skb,/* create a URB, and a buffer for it */ urb =usb_alloc_urb (0 ,GFP_ATOMIC ); -if (!urb) { -netdev_err (netdev,"No memory left for URB\n" ); +if (!urb) goto nomem_urb; - } hf =usb_alloc_coherent (dev->udev,sizeof (*hf),GFP_ATOMIC , &urb->transfer_dma);
@@ -600,11 +598,8 @@ static int gs_can_open(struct net_device *netdev)/* alloc rx urb */ urb =usb_alloc_urb (0 ,GFP_KERNEL ); -if (!urb) { -netdev_err (netdev, -"No memory left for URB\n" ); +if (!urb)return -ENOMEM ; - }/* alloc rx buffer */ buf = usb_alloc_coherent(dev->udev,
Signature · 6 lines
2.8.1 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 4/16 net: can: usb: kvaser_usb: don't print error when allocating urb fails
In reply to a message not in the archivekmalloc will print enough information in case of failure.
--- drivers/net/can/usb/kvaser_usb.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/net/can/usb/kvaser_usb.c +1 -6
@@ -787,10 +787,8 @@ static int kvaser_usb_simple_msg_async(struct kvaser_usb_net_priv *priv,int err; urb =usb_alloc_urb (0 ,GFP_ATOMIC ); -if (!urb) { -netdev_err (netdev,"No memory left for URBs\n" ); +if (!urb)return -ENOMEM ; - } buf =kmalloc (sizeof (struct kvaser_msg ),GFP_ATOMIC );if (!buf) {
@@ -1393,8 +1391,6 @@ static int kvaser_usb_setup_rx_urbs(struct kvaser_usb *dev) urb =usb_alloc_urb (0 ,GFP_KERNEL );if (!urb) { -dev_warn (dev->udev->dev.parent, -"No memory left for URBs\n" ); err = -ENOMEM ;break ; }
@@ -1670,7 +1666,6 @@ static netdev_tx_t kvaser_usb_start_xmit(struct sk_buff *skb, urb =usb_alloc_urb (0 ,GFP_ATOMIC );if (!urb) { -netdev_err (netdev,"No memory left for URBs\n" ); stats->tx_dropped++;dev_kfree_skb (skb);return NETDEV_TX_OK ;
Signature · 6 lines
2.8.1 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 5/16 net: can: usb: peak_usb: pcan_usb_core: don't print error when allocating urb fails
In reply to a message not in the archivekmalloc will print enough information in case of failure.
--- drivers/net/can/usb/peak_usb/pcan_usb_core.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/net/can/usb/peak_usb/pcan_usb_core.c +1 -5
@@ -399,7 +399,6 @@ static int peak_usb_start(struct peak_usb_device *dev)/* create a URB, and a buffer for it, to receive usb messages */ urb =usb_alloc_urb (0 ,GFP_KERNEL );if (!urb) { -netdev_err (netdev,"No memory left for URBs\n" ); err = -ENOMEM ;break ; }
@@ -454,7 +453,6 @@ static int peak_usb_start(struct peak_usb_device *dev)/* create a URB and a buffer for it, to transmit usb messages */ urb =usb_alloc_urb (0 ,GFP_KERNEL );if (!urb) { -netdev_err (netdev,"No memory left for URBs\n" ); err = -ENOMEM ;break ; }
@@ -651,10 +649,8 @@ static int peak_usb_restart(struct peak_usb_device *dev)/* first allocate a urb to handle the asynchronous steps */ urb =usb_alloc_urb (0 ,GFP_ATOMIC ); -if (!urb) { -netdev_err (dev->netdev,"no memory left for urb\n" ); +if (!urb)return -ENOMEM ; - }/* also allocate enough space for the commands to send */ buf =kmalloc (PCAN_USB_MAX_CMD_LEN ,GFP_ATOMIC );
Signature · 6 lines
2.8.1 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 6/16 net: can: usb: usb_8dev: don't print error when allocating urb fails
In reply to a message not in the archivekmalloc will print enough information in case of failure.
--- drivers/net/can/usb/usb_8dev.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/net/can/usb/usb_8dev.c +1 -4
@@ -623,10 +623,8 @@ static netdev_tx_t usb_8dev_start_xmit(struct sk_buff *skb,/* create a URB, and a buffer for it, and copy the data to the URB */ urb =usb_alloc_urb (0 ,GFP_ATOMIC ); -if (!urb) { -netdev_err (netdev,"No memory left for URBs\n" ); +if (!urb) goto nomem; - } buf =usb_alloc_coherent (priv->udev, size,GFP_ATOMIC , &urb->transfer_dma);
@@ -748,7 +746,6 @@ static int usb_8dev_start(struct usb_8dev_priv *priv)/* create a URB, and a buffer for it */ urb =usb_alloc_urb (0 ,GFP_KERNEL );if (!urb) { -netdev_err (netdev,"No memory left for URBs\n" ); err = -ENOMEM ;break ; }
Signature · 6 lines
2.8.1 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 7/16 net: usb: hso: don't print error when allocating urb fails
In reply to a message not in the archivekmalloc will print enough information in case of failure.
--- drivers/net/usb/hso.c | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-)
drivers/net/usb/hso.c +5 -15
@@ -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 );
Signature · 6 lines
2.8.1 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 8/16 net: usb: lan78xx: don't print error when allocating urb fails
In reply to a message not in the archivekmalloc will print enough information in case of failure.
--- drivers/net/usb/lan78xx.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/net/usb/lan78xx.c +1 -3
@@ -3002,10 +3002,8 @@ static void lan78xx_tx_bh(struct lan78xx_net *dev) gso_skb: urb =usb_alloc_urb (0 ,GFP_ATOMIC ); -if (!urb) { -netif_dbg (dev, tx_err, dev->net,"no urb\n" ); +if (!urb) goto drop; - } entry = (struct skb_data *)skb->cb; entry->urb = urb;
Signature · 6 lines
2.8.1 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1470949539-25392-9-git-send-email-wsa-dev-jBu1N2QxHDJrcw3mvpCnnVaTQe2KTcn/@public.gmane.org
[email protected]
Acked-byRE: [PATCH 08/16] net: usb: lan78xx: don't print error when allocating urb fails
Quoted 9 lines
-----Original Message-----
From: Wolfram Sang [mailto:wsa-dev-jBu1N2QxHDJrcw3mvpCnnVaTQe2KTcn/@public.gmane.org]
Sent: Thursday, August 11, 2016 5:05 PM
To: [email protected]
Cc: Wolfram Sang; Woojung Huh - C21699; UNGLinuxDriver; [email protected]
Subject: [PATCH 08/16] net: usb: lan78xx: don't print error when allocating urb fails
Quoted 6 lines
kmalloc will print enough information in case of failure.
--- drivers/net/usb/lan78xx.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 9/16 net: usb: usbnet: don't print error when allocating urb fails
In reply to a message not in the archivekmalloc will print enough information in case of failure.
--- drivers/net/usb/usbnet.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/net/usb/usbnet.c +1 -4
@@ -2062,11 +2062,8 @@ int usbnet_write_cmd_async(struct usbnet *dev, u8 cmd, u8 reqtype, cmd, reqtype, value, index, size); urb =usb_alloc_urb (0 ,GFP_ATOMIC ); -if (!urb) { -netdev_err (dev->net,"Error allocating URB in" -" %s!\n" , __func__); +if (!urb) goto fail; - }if (data) { buf =kmemdup (data, size,GFP_ATOMIC );
Signature · 6 lines
2.8.1 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 10/16 net: wimax: i2400m: usb-notif: don't print error when allocating urb fails
In reply to a message not in the archivekmalloc will print enough information in case of failure.
--- drivers/net/wimax/i2400m/usb-notif.c | 1 - 1 file changed, 1 deletion(-)
drivers/net/wimax/i2400m/usb-notif.c +0 -1
@@ -206,7 +206,6 @@ int i2400mu_notification_setup(struct i2400mu *i2400mu) i2400mu->notif_urb =usb_alloc_urb (0 ,GFP_KERNEL );if (!i2400mu->notif_urb) { ret = -ENOMEM ; -dev_err (dev,"notification: cannot allocate URB\n" ); goto error_alloc_urb; } epd = usb_get_epd(i2400mu->usb_iface,
Signature · 6 lines
2.8.1 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 11/16 net: wireless: ath: ar5523: ar5523: don't print error when allocating urb fails
In reply to a message not in the archivekmalloc will print enough information in case of failure.
--- drivers/net/wireless/ath/ar5523/ar5523.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
drivers/net/wireless/ath/ar5523/ar5523.c +2 -7
@@ -706,10 +706,8 @@ static int ar5523_alloc_rx_bufs(struct ar5523 *ar) data->ar = ar; data->urb =usb_alloc_urb (0 ,GFP_KERNEL ); -if (!data->urb) { -ar5523_err (ar,"could not allocate rx data urb\n" ); +if (!data->urb) goto err; - }list_add_tail (&data->list, &ar->rx_data_free);atomic_inc (&ar->rx_data_free_cnt); }
@@ -824,7 +822,6 @@ static void ar5523_tx_work_locked(struct ar5523 *ar) urb =usb_alloc_urb (0 ,GFP_KERNEL );if (!urb) { -ar5523_err (ar,"Failed to allocate TX urb\n" );ieee80211_free_txskb (ar->hw, skb);continue ; }
@@ -949,10 +946,8 @@ static int ar5523_alloc_tx_cmd(struct ar5523 *ar)init_completion (&cmd->done); cmd->urb_tx =usb_alloc_urb (0 ,GFP_KERNEL ); -if (!cmd->urb_tx) { -ar5523_err (ar,"could not allocate urb\n" ); +if (!cmd->urb_tx)return -ENOMEM ; - } cmd->buf_tx =usb_alloc_coherent (ar->dev,AR5523_MAX_TXCMDSZ ,GFP_KERNEL , &cmd->urb_tx->transfer_dma);
Signature · 6 lines
2.8.1 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 12/16 net: wireless: broadcom: brcm80211: brcmfmac: usb: don't print error when allocating urb fails
In reply to a message not in the archivekmalloc will print enough information in case of failure.
--- drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c +2 -6
@@ -1099,15 +1099,11 @@ struct brcmf_usbdev *brcmf_usb_attach(struct brcmf_usbdev_info *devinfo, devinfo->tx_freecount = ntxq; devinfo->ctl_urb =usb_alloc_urb (0 ,GFP_ATOMIC ); -if (!devinfo->ctl_urb) { -brcmf_err ("usb_alloc_urb (ctl) failed\n" ); +if (!devinfo->ctl_urb) goto error; - } devinfo->bulk_urb =usb_alloc_urb (0 ,GFP_ATOMIC ); -if (!devinfo->bulk_urb) { -brcmf_err ("usb_alloc_urb (bulk) failed\n" ); +if (!devinfo->bulk_urb) goto error; - }return &devinfo->bus_pub;
Signature · 6 lines
2.8.1 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
From: Wolfram Sang <wsa-dev-jBu1N2QxHDJrcw3mvpCnnVaTQe2KTcn/@public.gmane.org>
Date: Thu, 11 Aug 2016 23:05:19 +0200
Quoted 5 lines
This per-subsystem series is part of a tree wide cleanup.
usb_alloc_urb()uses kmalloc which already prints enough information on failure. So, let's simply remove those "allocation failed" messages from drivers like we did already for other-ENOMEMcases. gkh acked this approach when we talked about it at LCJ in Tokyo a few weeks ago.
Series applied to net-next, thank you.
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 13/16 net: wireless: intersil: orinoco: orinoco_usb: don't print error when allocating urb fails
In reply to Wolfram Sangkmalloc will print enough information in case of failure.
--- drivers/net/wireless/intersil/orinoco/orinoco_usb.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/net/wireless/intersil/orinoco/orinoco_usb.c +1 -3
@@ -1613,10 +1613,8 @@ static int ezusb_probe(struct usb_interface *interface, } upriv->read_urb =usb_alloc_urb (0 ,GFP_KERNEL ); -if (!upriv->read_urb) { -err ("No free urbs available" ); +if (!upriv->read_urb) goto error; - }if (le16_to_cpu (ep->wMaxPacketSize) !=64 )pr_warn ("bulk in: wMaxPacketSize!= 64\n" );if (ep->bEndpointAddress != (2 |USB_DIR_IN ))
Signature · 1 line
2.8.1
PATCH 14/16 net: wireless: marvell: libertas_tf: if_usb: don't print error when allocating urb fails
kmalloc will print enough information in case of failure.
--- drivers/net/wireless/marvell/libertas_tf/if_usb.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-)
drivers/net/wireless/marvell/libertas_tf/if_usb.c +3 -9
@@ -198,22 +198,16 @@ static int if_usb_probe(struct usb_interface *intf, } cardp->rx_urb =usb_alloc_urb (0 ,GFP_KERNEL ); -if (!cardp->rx_urb) { -lbtf_deb_usbd (&udev->dev,"Rx URB allocation failed\n" ); +if (!cardp->rx_urb) goto dealloc; - } cardp->tx_urb =usb_alloc_urb (0 ,GFP_KERNEL ); -if (!cardp->tx_urb) { -lbtf_deb_usbd (&udev->dev,"Tx URB allocation failed\n" ); +if (!cardp->tx_urb) goto dealloc; - } cardp->cmd_urb =usb_alloc_urb (0 ,GFP_KERNEL ); -if (!cardp->cmd_urb) { -lbtf_deb_usbd (&udev->dev,"Cmd URB allocation failed\n" ); +if (!cardp->cmd_urb) goto dealloc; - } cardp->ep_out_buf =kmalloc (MRVDRV_ETH_TX_PACKET_BUFFER_SIZE ,GFP_KERNEL );
Signature · 1 line
2.8.1
PATCH 15/16 net: wireless: marvell: mwifiex: usb: don't print error when allocating urb fails
In reply to Wolfram Sangkmalloc will print enough information in case of failure.
--- drivers/net/wireless/marvell/mwifiex/usb.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-)
drivers/net/wireless/marvell/mwifiex/usb.c +4 -15
@@ -657,11 +657,8 @@ static int mwifiex_usb_tx_init(struct mwifiex_adapter *adapter) card->tx_cmd.ep = card->tx_cmd_ep; card->tx_cmd.urb =usb_alloc_urb (0 ,GFP_KERNEL ); -if (!card->tx_cmd.urb) { -mwifiex_dbg (adapter,ERROR , -"tx_cmd.urb allocation failed\n" ); +if (!card->tx_cmd.urb)return -ENOMEM ; - }for (i =0 ; i <MWIFIEX_TX_DATA_PORT ; i++) { port = &card->port[i];
@@ -677,11 +674,8 @@ static int mwifiex_usb_tx_init(struct mwifiex_adapter *adapter) port->tx_data_list[j].ep = port->tx_data_ep; port->tx_data_list[j].urb =usb_alloc_urb (0 ,GFP_KERNEL ); -if (!port->tx_data_list[j].urb) { -mwifiex_dbg (adapter,ERROR , -"urb allocation failed\n" ); +if (!port->tx_data_list[j].urb)return -ENOMEM ; - } } }
@@ -697,10 +691,8 @@ static int mwifiex_usb_rx_init(struct mwifiex_adapter *adapter) card->rx_cmd.ep = card->rx_cmd_ep; card->rx_cmd.urb =usb_alloc_urb (0 ,GFP_KERNEL ); -if (!card->rx_cmd.urb) { -mwifiex_dbg (adapter,ERROR ,"rx_cmd.urb allocation failed\n" ); +if (!card->rx_cmd.urb)return -ENOMEM ; - } card->rx_cmd.skb =dev_alloc_skb (MWIFIEX_RX_CMD_BUF_SIZE );if (!card->rx_cmd.skb)
@@ -714,11 +706,8 @@ static int mwifiex_usb_rx_init(struct mwifiex_adapter *adapter) card->rx_data_list[i].ep = card->rx_data_ep; card->rx_data_list[i].urb =usb_alloc_urb (0 ,GFP_KERNEL ); -if (!card->rx_data_list[i].urb) { -mwifiex_dbg (adapter,ERROR , -"rx_data_list[] urb allocation failed\n" ); +if (!card->rx_data_list[i].urb)return -1 ; - }if (mwifiex_usb_submit_rx_urb (&card->rx_data_list[i],MWIFIEX_RX_DATA_BUF_SIZE ))return -1 ;
Signature · 1 line
2.8.1
PATCH 16/16 net: wireless: realtek: rtlwifi: usb: don't print error when allocating urb fails
In reply to Wolfram Sangkmalloc will print enough information in case of failure.
--- drivers/net/wireless/realtek/rtlwifi/usb.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/net/wireless/realtek/rtlwifi/usb.c +1 -7
@@ -739,11 +739,8 @@ static int _rtl_usb_receive(struct ieee80211_hw *hw)for (i =0 ; i < rtlusb->rx_urb_num; i++) { err = -ENOMEM ; urb =usb_alloc_urb (0 ,GFP_KERNEL ); -if (!urb) { -RT_TRACE (rtlpriv,COMP_USB ,DBG_EMERG , -"Failed to alloc URB!!\n" ); +if (!urb) goto err_out; - } err =_rtl_prep_rx_urb (hw, rtlusb, urb,GFP_KERNEL );if (err <0 ) {
@@ -907,15 +904,12 @@ static void _rtl_tx_complete(struct urb *urb)static struct urb *_rtl_usb_tx_urb_setup (struct ieee80211_hw *hw,struct sk_buff *skb,u32 ep_num) { -struct rtl_priv *rtlpriv =rtl_priv (hw);struct rtl_usb *rtlusb =rtl_usbdev (rtl_usbpriv (hw));struct urb *_urb;WARN_ON (NULL == skb); _urb =usb_alloc_urb (0 ,GFP_ATOMIC );if (!_urb) { -RT_TRACE (rtlpriv,COMP_USB ,DBG_EMERG , -"Can't allocate URB for bulk out!\n" );kfree_skb (skb);return NULL ; }
Signature · 6 lines
2.8.1 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 16/16] net: wireless: realtek: rtlwifi: usb: don't print error when allocating urb fails
Quoted 6 lines · Wolfram Sang
kmalloc will print enough information in case of failure.
Signed-off-by Wolfram Sang <[email protected]>--- drivers/net/wireless/realtek/rtlwifi/usb.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
Quoted 35 lines
drivers/net/wireless/realtek/rtlwifi/usb.c +1
-7@@ -739,11 +739,8 @@ static int _rtl_usb_receive(struct ieee80211_hw *hw)for (i =0 ; i < rtlusb->rx_urb_num; i++) { err = -ENOMEM ; urb =usb_alloc_urb (0 ,GFP_KERNEL ); -if (!urb) { -RT_TRACE (rtlpriv,COMP_USB ,DBG_EMERG , -"Failed to alloc URB!!\n" ); +if (!urb) goto err_out; - } err =_rtl_prep_rx_urb (hw, rtlusb, urb,GFP_KERNEL );if (err <0 ) {@@ -907,15 +904,12 @@ static void _rtl_tx_complete(struct urb *urb)static struct urb *_rtl_usb_tx_urb_setup (struct ieee80211_hw *hw,struct sk_buff *skb,u32 ep_num) { -struct rtl_priv *rtlpriv =rtl_priv (hw);struct rtl_usb *rtlusb =rtl_usbdev (rtl_usbpriv (hw));struct urb *_urb;WARN_ON (NULL == skb); _urb =usb_alloc_urb (0 ,GFP_ATOMIC );if (!_urb) { -RT_TRACE (rtlpriv,COMP_USB ,DBG_EMERG , -"Can't allocate URB for bulk out!\n" );kfree_skb (skb);return NULL ; }