diff options
author | Joe Perches <joe@perches.com> | 2013-02-03 12:28:11 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-02-04 13:22:34 -0500 |
commit | 38673c8218a6bcaac97b0243089e33617e28f43f (patch) | |
tree | 6d591fbe322271bcc18711322bf954cc67cccfda /drivers/net/usb | |
parent | b2adaca92c63b9bb8beb021d554f656e387a7648 (diff) |
drivers: net: usb: Remove unnecessary alloc/OOM messages
alloc failures already get standardized OOM
messages and a dump_stack.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb')
-rw-r--r-- | drivers/net/usb/ax88172a.c | 6 | ||||
-rw-r--r-- | drivers/net/usb/hso.c | 25 | ||||
-rw-r--r-- | drivers/net/usb/sierra_net.c | 10 | ||||
-rw-r--r-- | drivers/net/usb/smsc75xx.c | 6 | ||||
-rw-r--r-- | drivers/net/usb/smsc95xx.c | 6 | ||||
-rw-r--r-- | drivers/net/usb/usbnet.c | 5 |
6 files changed, 17 insertions, 41 deletions
diff --git a/drivers/net/usb/ax88172a.c b/drivers/net/usb/ax88172a.c index 76ee5410d69e..d012203b0f29 100644 --- a/drivers/net/usb/ax88172a.c +++ b/drivers/net/usb/ax88172a.c | |||
@@ -117,7 +117,6 @@ static int ax88172a_init_mdio(struct usbnet *dev) | |||
117 | 117 | ||
118 | priv->mdio->irq = kzalloc(sizeof(int) * PHY_MAX_ADDR, GFP_KERNEL); | 118 | priv->mdio->irq = kzalloc(sizeof(int) * PHY_MAX_ADDR, GFP_KERNEL); |
119 | if (!priv->mdio->irq) { | 119 | if (!priv->mdio->irq) { |
120 | netdev_err(dev->net, "Could not allocate mdio->irq\n"); | ||
121 | ret = -ENOMEM; | 120 | ret = -ENOMEM; |
122 | goto mfree; | 121 | goto mfree; |
123 | } | 122 | } |
@@ -236,10 +235,9 @@ static int ax88172a_bind(struct usbnet *dev, struct usb_interface *intf) | |||
236 | usbnet_get_endpoints(dev, intf); | 235 | usbnet_get_endpoints(dev, intf); |
237 | 236 | ||
238 | priv = kzalloc(sizeof(*priv), GFP_KERNEL); | 237 | priv = kzalloc(sizeof(*priv), GFP_KERNEL); |
239 | if (!priv) { | 238 | if (!priv) |
240 | netdev_err(dev->net, "Could not allocate memory for private data\n"); | ||
241 | return -ENOMEM; | 239 | return -ENOMEM; |
242 | } | 240 | |
243 | dev->driver_priv = priv; | 241 | dev->driver_priv = priv; |
244 | 242 | ||
245 | /* Get the MAC address */ | 243 | /* Get the MAC address */ |
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c index cd8ccb240f4b..41e5dfb5ee64 100644 --- a/drivers/net/usb/hso.c +++ b/drivers/net/usb/hso.c | |||
@@ -2317,10 +2317,8 @@ static int hso_serial_common_create(struct hso_serial *serial, int num_urbs, | |||
2317 | serial->rx_urb[i]->transfer_buffer_length = 0; | 2317 | serial->rx_urb[i]->transfer_buffer_length = 0; |
2318 | serial->rx_data[i] = kzalloc(serial->rx_data_length, | 2318 | serial->rx_data[i] = kzalloc(serial->rx_data_length, |
2319 | GFP_KERNEL); | 2319 | GFP_KERNEL); |
2320 | if (!serial->rx_data[i]) { | 2320 | if (!serial->rx_data[i]) |
2321 | dev_err(dev, "%s - Out of memory\n", __func__); | ||
2322 | goto exit; | 2321 | goto exit; |
2323 | } | ||
2324 | } | 2322 | } |
2325 | 2323 | ||
2326 | /* TX, allocate urb and initialize */ | 2324 | /* TX, allocate urb and initialize */ |
@@ -2336,15 +2334,12 @@ static int hso_serial_common_create(struct hso_serial *serial, int num_urbs, | |||
2336 | serial->tx_buffer_count = 0; | 2334 | serial->tx_buffer_count = 0; |
2337 | serial->tx_data_length = tx_size; | 2335 | serial->tx_data_length = tx_size; |
2338 | serial->tx_data = kzalloc(serial->tx_data_length, GFP_KERNEL); | 2336 | serial->tx_data = kzalloc(serial->tx_data_length, GFP_KERNEL); |
2339 | if (!serial->tx_data) { | 2337 | if (!serial->tx_data) |
2340 | dev_err(dev, "%s - Out of memory\n", __func__); | ||
2341 | goto exit; | 2338 | goto exit; |
2342 | } | 2339 | |
2343 | serial->tx_buffer = kzalloc(serial->tx_data_length, GFP_KERNEL); | 2340 | serial->tx_buffer = kzalloc(serial->tx_data_length, GFP_KERNEL); |
2344 | if (!serial->tx_buffer) { | 2341 | if (!serial->tx_buffer) |
2345 | dev_err(dev, "%s - Out of memory\n", __func__); | ||
2346 | goto exit; | 2342 | goto exit; |
2347 | } | ||
2348 | 2343 | ||
2349 | return 0; | 2344 | return 0; |
2350 | exit: | 2345 | exit: |
@@ -2580,10 +2575,8 @@ static struct hso_device *hso_create_net_device(struct usb_interface *interface, | |||
2580 | } | 2575 | } |
2581 | hso_net->mux_bulk_rx_buf_pool[i] = kzalloc(MUX_BULK_RX_BUF_SIZE, | 2576 | hso_net->mux_bulk_rx_buf_pool[i] = kzalloc(MUX_BULK_RX_BUF_SIZE, |
2582 | GFP_KERNEL); | 2577 | GFP_KERNEL); |
2583 | if (!hso_net->mux_bulk_rx_buf_pool[i]) { | 2578 | if (!hso_net->mux_bulk_rx_buf_pool[i]) |
2584 | dev_err(&interface->dev, "Could not allocate rx buf\n"); | ||
2585 | goto exit; | 2579 | goto exit; |
2586 | } | ||
2587 | } | 2580 | } |
2588 | hso_net->mux_bulk_tx_urb = usb_alloc_urb(0, GFP_KERNEL); | 2581 | hso_net->mux_bulk_tx_urb = usb_alloc_urb(0, GFP_KERNEL); |
2589 | if (!hso_net->mux_bulk_tx_urb) { | 2582 | if (!hso_net->mux_bulk_tx_urb) { |
@@ -2591,10 +2584,8 @@ static struct hso_device *hso_create_net_device(struct usb_interface *interface, | |||
2591 | goto exit; | 2584 | goto exit; |
2592 | } | 2585 | } |
2593 | hso_net->mux_bulk_tx_buf = kzalloc(MUX_BULK_TX_BUF_SIZE, GFP_KERNEL); | 2586 | hso_net->mux_bulk_tx_buf = kzalloc(MUX_BULK_TX_BUF_SIZE, GFP_KERNEL); |
2594 | if (!hso_net->mux_bulk_tx_buf) { | 2587 | if (!hso_net->mux_bulk_tx_buf) |
2595 | dev_err(&interface->dev, "Could not allocate tx buf\n"); | ||
2596 | goto exit; | 2588 | goto exit; |
2597 | } | ||
2598 | 2589 | ||
2599 | add_net_device(hso_dev); | 2590 | add_net_device(hso_dev); |
2600 | 2591 | ||
@@ -2818,10 +2809,8 @@ struct hso_shared_int *hso_create_shared_int(struct usb_interface *interface) | |||
2818 | mux->shared_intr_buf = | 2809 | mux->shared_intr_buf = |
2819 | kzalloc(le16_to_cpu(mux->intr_endp->wMaxPacketSize), | 2810 | kzalloc(le16_to_cpu(mux->intr_endp->wMaxPacketSize), |
2820 | GFP_KERNEL); | 2811 | GFP_KERNEL); |
2821 | if (!mux->shared_intr_buf) { | 2812 | if (!mux->shared_intr_buf) |
2822 | dev_err(&interface->dev, "Could not allocate intr buf?\n"); | ||
2823 | goto exit; | 2813 | goto exit; |
2824 | } | ||
2825 | 2814 | ||
2826 | mutex_init(&mux->shared_int_lock); | 2815 | mutex_init(&mux->shared_int_lock); |
2827 | 2816 | ||
diff --git a/drivers/net/usb/sierra_net.c b/drivers/net/usb/sierra_net.c index 453aa6c1277c..79ab2435d9d3 100644 --- a/drivers/net/usb/sierra_net.c +++ b/drivers/net/usb/sierra_net.c | |||
@@ -459,11 +459,9 @@ static void sierra_net_kevent(struct work_struct *work) | |||
459 | 459 | ||
460 | /* Query the modem for the LSI message */ | 460 | /* Query the modem for the LSI message */ |
461 | buf = kzalloc(SIERRA_NET_USBCTL_BUF_LEN, GFP_KERNEL); | 461 | buf = kzalloc(SIERRA_NET_USBCTL_BUF_LEN, GFP_KERNEL); |
462 | if (!buf) { | 462 | if (!buf) |
463 | netdev_err(dev->net, | ||
464 | "failed to allocate buf for LS msg\n"); | ||
465 | return; | 463 | return; |
466 | } | 464 | |
467 | ifnum = priv->ifnum; | 465 | ifnum = priv->ifnum; |
468 | len = usb_control_msg(dev->udev, usb_rcvctrlpipe(dev->udev, 0), | 466 | len = usb_control_msg(dev->udev, usb_rcvctrlpipe(dev->udev, 0), |
469 | USB_CDC_GET_ENCAPSULATED_RESPONSE, | 467 | USB_CDC_GET_ENCAPSULATED_RESPONSE, |
@@ -686,10 +684,8 @@ static int sierra_net_bind(struct usbnet *dev, struct usb_interface *intf) | |||
686 | } | 684 | } |
687 | /* Initialize sierra private data */ | 685 | /* Initialize sierra private data */ |
688 | priv = kzalloc(sizeof *priv, GFP_KERNEL); | 686 | priv = kzalloc(sizeof *priv, GFP_KERNEL); |
689 | if (!priv) { | 687 | if (!priv) |
690 | dev_err(&dev->udev->dev, "No memory"); | ||
691 | return -ENOMEM; | 688 | return -ENOMEM; |
692 | } | ||
693 | 689 | ||
694 | priv->usbnet = dev; | 690 | priv->usbnet = dev; |
695 | priv->ifnum = ifacenum; | 691 | priv->ifnum = ifacenum; |
diff --git a/drivers/net/usb/smsc75xx.c b/drivers/net/usb/smsc75xx.c index 251a3354a4b0..9abe51710f22 100644 --- a/drivers/net/usb/smsc75xx.c +++ b/drivers/net/usb/smsc75xx.c | |||
@@ -1393,13 +1393,11 @@ static int smsc75xx_bind(struct usbnet *dev, struct usb_interface *intf) | |||
1393 | } | 1393 | } |
1394 | 1394 | ||
1395 | dev->data[0] = (unsigned long)kzalloc(sizeof(struct smsc75xx_priv), | 1395 | dev->data[0] = (unsigned long)kzalloc(sizeof(struct smsc75xx_priv), |
1396 | GFP_KERNEL); | 1396 | GFP_KERNEL); |
1397 | 1397 | ||
1398 | pdata = (struct smsc75xx_priv *)(dev->data[0]); | 1398 | pdata = (struct smsc75xx_priv *)(dev->data[0]); |
1399 | if (!pdata) { | 1399 | if (!pdata) |
1400 | netdev_warn(dev->net, "Unable to allocate smsc75xx_priv\n"); | ||
1401 | return -ENOMEM; | 1400 | return -ENOMEM; |
1402 | } | ||
1403 | 1401 | ||
1404 | pdata->dev = dev; | 1402 | pdata->dev = dev; |
1405 | 1403 | ||
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c index 6a74a68220be..ff4fa37dfd1d 100644 --- a/drivers/net/usb/smsc95xx.c +++ b/drivers/net/usb/smsc95xx.c | |||
@@ -1116,13 +1116,11 @@ static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf) | |||
1116 | } | 1116 | } |
1117 | 1117 | ||
1118 | dev->data[0] = (unsigned long)kzalloc(sizeof(struct smsc95xx_priv), | 1118 | dev->data[0] = (unsigned long)kzalloc(sizeof(struct smsc95xx_priv), |
1119 | GFP_KERNEL); | 1119 | GFP_KERNEL); |
1120 | 1120 | ||
1121 | pdata = (struct smsc95xx_priv *)(dev->data[0]); | 1121 | pdata = (struct smsc95xx_priv *)(dev->data[0]); |
1122 | if (!pdata) { | 1122 | if (!pdata) |
1123 | netdev_warn(dev->net, "Unable to allocate struct smsc95xx_priv\n"); | ||
1124 | return -ENOMEM; | 1123 | return -ENOMEM; |
1125 | } | ||
1126 | 1124 | ||
1127 | spin_lock_init(&pdata->mac_cr_lock); | 1125 | spin_lock_init(&pdata->mac_cr_lock); |
1128 | 1126 | ||
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index f34b2ebee815..30c1b330e983 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c | |||
@@ -1790,11 +1790,8 @@ int usbnet_write_cmd_async(struct usbnet *dev, u8 cmd, u8 reqtype, | |||
1790 | } | 1790 | } |
1791 | 1791 | ||
1792 | req = kmalloc(sizeof(struct usb_ctrlrequest), GFP_ATOMIC); | 1792 | req = kmalloc(sizeof(struct usb_ctrlrequest), GFP_ATOMIC); |
1793 | if (!req) { | 1793 | if (!req) |
1794 | netdev_err(dev->net, "Failed to allocate memory for %s\n", | ||
1795 | __func__); | ||
1796 | goto fail_free_buf; | 1794 | goto fail_free_buf; |
1797 | } | ||
1798 | 1795 | ||
1799 | req->bRequestType = reqtype; | 1796 | req->bRequestType = reqtype; |
1800 | req->bRequest = cmd; | 1797 | req->bRequest = cmd; |