Commit 09da6c5f60ad2e2018366e47192a9ddbccfb3ac5
Committed by
David S. Miller
1 parent
ad4437d4ed
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
can: Remove unnecessary alloc/OOM messages
alloc failures already get standardized OOM messages and a dump_stack. Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Showing 8 changed files with 3 additions and 20 deletions Side-by-side Diff
drivers/net/can/sja1000/ems_pci.c
... | ... | @@ -238,7 +238,6 @@ |
238 | 238 | /* Allocating card structures to hold addresses, ... */ |
239 | 239 | card = kzalloc(sizeof(struct ems_pci_card), GFP_KERNEL); |
240 | 240 | if (card == NULL) { |
241 | - dev_err(&pdev->dev, "Unable to allocate memory\n"); | |
242 | 241 | pci_disable_device(pdev); |
243 | 242 | return -ENOMEM; |
244 | 243 | } |
drivers/net/can/sja1000/peak_pci.c
... | ... | @@ -451,11 +451,8 @@ |
451 | 451 | } else { |
452 | 452 | /* create the bit banging I2C adapter structure */ |
453 | 453 | card = kzalloc(sizeof(struct peak_pciec_card), GFP_KERNEL); |
454 | - if (!card) { | |
455 | - dev_err(&pdev->dev, | |
456 | - "failed allocating memory for i2c chip\n"); | |
454 | + if (!card) | |
457 | 455 | return -ENOMEM; |
458 | - } | |
459 | 456 | |
460 | 457 | card->cfg_base = chan->cfg_base; |
461 | 458 | card->reg_base = priv->reg_base; |
drivers/net/can/sja1000/peak_pcmcia.c
drivers/net/can/sja1000/plx_pci.c
drivers/net/can/usb/ems_usb.c
... | ... | @@ -1014,10 +1014,8 @@ |
1014 | 1014 | } |
1015 | 1015 | |
1016 | 1016 | dev->intr_in_buffer = kzalloc(INTR_IN_BUFFER_SIZE, GFP_KERNEL); |
1017 | - if (!dev->intr_in_buffer) { | |
1018 | - dev_err(&intf->dev, "Couldn't alloc Intr buffer\n"); | |
1017 | + if (!dev->intr_in_buffer) | |
1019 | 1018 | goto cleanup_intr_urb; |
1020 | - } | |
1021 | 1019 | |
1022 | 1020 | dev->tx_msg_buffer = kzalloc(CPC_HEADER_SIZE + |
1023 | 1021 | sizeof(struct ems_cpc_msg), GFP_KERNEL); |
drivers/net/can/usb/kvaser_usb.c
... | ... | @@ -561,7 +561,6 @@ |
561 | 561 | |
562 | 562 | buf = kmalloc(sizeof(struct kvaser_msg), GFP_ATOMIC); |
563 | 563 | if (!buf) { |
564 | - netdev_err(netdev, "No memory left for USB buffer\n"); | |
565 | 564 | usb_free_urb(urb); |
566 | 565 | return -ENOMEM; |
567 | 566 | } |
... | ... | @@ -1268,7 +1267,6 @@ |
1268 | 1267 | |
1269 | 1268 | buf = kmalloc(sizeof(struct kvaser_msg), GFP_ATOMIC); |
1270 | 1269 | if (!buf) { |
1271 | - netdev_err(netdev, "No memory left for USB buffer\n"); | |
1272 | 1270 | stats->tx_dropped++; |
1273 | 1271 | goto nobufmem; |
1274 | 1272 | } |
drivers/net/can/usb/peak_usb/pcan_usb_core.c
... | ... | @@ -386,7 +386,6 @@ |
386 | 386 | |
387 | 387 | buf = kmalloc(dev->adapter->rx_buffer_size, GFP_KERNEL); |
388 | 388 | if (!buf) { |
389 | - netdev_err(netdev, "No memory left for USB buffer\n"); | |
390 | 389 | usb_free_urb(urb); |
391 | 390 | err = -ENOMEM; |
392 | 391 | break; |
... | ... | @@ -442,7 +441,6 @@ |
442 | 441 | |
443 | 442 | buf = kmalloc(dev->adapter->tx_buffer_size, GFP_KERNEL); |
444 | 443 | if (!buf) { |
445 | - netdev_err(netdev, "No memory left for USB buffer\n"); | |
446 | 444 | usb_free_urb(urb); |
447 | 445 | err = -ENOMEM; |
448 | 446 | break; |
... | ... | @@ -634,7 +632,6 @@ |
634 | 632 | /* also allocate enough space for the commands to send */ |
635 | 633 | buf = kmalloc(PCAN_USB_MAX_CMD_LEN, GFP_ATOMIC); |
636 | 634 | if (!buf) { |
637 | - netdev_err(dev->netdev, "no memory left for async cmd\n"); | |
638 | 635 | usb_free_urb(urb); |
639 | 636 | return -ENOMEM; |
640 | 637 | } |
... | ... | @@ -729,8 +726,6 @@ |
729 | 726 | /* allocate a buffer large enough to send commands */ |
730 | 727 | dev->cmd_buf = kmalloc(PCAN_USB_MAX_CMD_LEN, GFP_KERNEL); |
731 | 728 | if (!dev->cmd_buf) { |
732 | - dev_err(&intf->dev, "%s: couldn't alloc cmd buffer\n", | |
733 | - PCAN_USB_DRIVER_NAME); | |
734 | 729 | err = -ENOMEM; |
735 | 730 | goto lbl_set_intf_data; |
736 | 731 | } |
drivers/net/can/usb/usb_8dev.c
... | ... | @@ -958,10 +958,8 @@ |
958 | 958 | |
959 | 959 | priv->cmd_msg_buffer = kzalloc(sizeof(struct usb_8dev_cmd_msg), |
960 | 960 | GFP_KERNEL); |
961 | - if (!priv->cmd_msg_buffer) { | |
962 | - netdev_err(netdev, "Couldn't alloc Tx buffer\n"); | |
961 | + if (!priv->cmd_msg_buffer) | |
963 | 962 | goto cleanup_candev; |
964 | - } | |
965 | 963 | |
966 | 964 | usb_set_intfdata(intf, priv); |
967 | 965 |