Commit 09da6c5f authored by Joe Perches's avatar Joe Perches Committed by David S. Miller

can: Remove unnecessary alloc/OOM messages

alloc failures already get standardized OOM
messages and a dump_stack.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Acked-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ad4437d4
...@@ -238,7 +238,6 @@ static int ems_pci_add_card(struct pci_dev *pdev, ...@@ -238,7 +238,6 @@ static int ems_pci_add_card(struct pci_dev *pdev,
/* Allocating card structures to hold addresses, ... */ /* Allocating card structures to hold addresses, ... */
card = kzalloc(sizeof(struct ems_pci_card), GFP_KERNEL); card = kzalloc(sizeof(struct ems_pci_card), GFP_KERNEL);
if (card == NULL) { if (card == NULL) {
dev_err(&pdev->dev, "Unable to allocate memory\n");
pci_disable_device(pdev); pci_disable_device(pdev);
return -ENOMEM; return -ENOMEM;
} }
......
...@@ -451,11 +451,8 @@ static int peak_pciec_probe(struct pci_dev *pdev, struct net_device *dev) ...@@ -451,11 +451,8 @@ static int peak_pciec_probe(struct pci_dev *pdev, struct net_device *dev)
} else { } else {
/* create the bit banging I2C adapter structure */ /* create the bit banging I2C adapter structure */
card = kzalloc(sizeof(struct peak_pciec_card), GFP_KERNEL); card = kzalloc(sizeof(struct peak_pciec_card), GFP_KERNEL);
if (!card) { if (!card)
dev_err(&pdev->dev,
"failed allocating memory for i2c chip\n");
return -ENOMEM; return -ENOMEM;
}
card->cfg_base = chan->cfg_base; card->cfg_base = chan->cfg_base;
card->reg_base = priv->reg_base; card->reg_base = priv->reg_base;
......
...@@ -660,7 +660,6 @@ static int pcan_probe(struct pcmcia_device *pdev) ...@@ -660,7 +660,6 @@ static int pcan_probe(struct pcmcia_device *pdev)
card = kzalloc(sizeof(struct pcan_pccard), GFP_KERNEL); card = kzalloc(sizeof(struct pcan_pccard), GFP_KERNEL);
if (!card) { if (!card) {
dev_err(&pdev->dev, "couldn't allocate card memory\n");
err = -ENOMEM; err = -ENOMEM;
goto probe_err_2; goto probe_err_2;
} }
......
...@@ -508,7 +508,6 @@ static int plx_pci_add_card(struct pci_dev *pdev, ...@@ -508,7 +508,6 @@ static int plx_pci_add_card(struct pci_dev *pdev,
/* Allocate card structures to hold addresses, ... */ /* Allocate card structures to hold addresses, ... */
card = kzalloc(sizeof(*card), GFP_KERNEL); card = kzalloc(sizeof(*card), GFP_KERNEL);
if (!card) { if (!card) {
dev_err(&pdev->dev, "Unable to allocate memory\n");
pci_disable_device(pdev); pci_disable_device(pdev);
return -ENOMEM; return -ENOMEM;
} }
......
...@@ -1014,10 +1014,8 @@ static int ems_usb_probe(struct usb_interface *intf, ...@@ -1014,10 +1014,8 @@ static int ems_usb_probe(struct usb_interface *intf,
} }
dev->intr_in_buffer = kzalloc(INTR_IN_BUFFER_SIZE, GFP_KERNEL); dev->intr_in_buffer = kzalloc(INTR_IN_BUFFER_SIZE, GFP_KERNEL);
if (!dev->intr_in_buffer) { if (!dev->intr_in_buffer)
dev_err(&intf->dev, "Couldn't alloc Intr buffer\n");
goto cleanup_intr_urb; goto cleanup_intr_urb;
}
dev->tx_msg_buffer = kzalloc(CPC_HEADER_SIZE + dev->tx_msg_buffer = kzalloc(CPC_HEADER_SIZE +
sizeof(struct ems_cpc_msg), GFP_KERNEL); sizeof(struct ems_cpc_msg), GFP_KERNEL);
......
...@@ -561,7 +561,6 @@ static int kvaser_usb_simple_msg_async(struct kvaser_usb_net_priv *priv, ...@@ -561,7 +561,6 @@ static int kvaser_usb_simple_msg_async(struct kvaser_usb_net_priv *priv,
buf = kmalloc(sizeof(struct kvaser_msg), GFP_ATOMIC); buf = kmalloc(sizeof(struct kvaser_msg), GFP_ATOMIC);
if (!buf) { if (!buf) {
netdev_err(netdev, "No memory left for USB buffer\n");
usb_free_urb(urb); usb_free_urb(urb);
return -ENOMEM; return -ENOMEM;
} }
...@@ -1268,7 +1267,6 @@ static netdev_tx_t kvaser_usb_start_xmit(struct sk_buff *skb, ...@@ -1268,7 +1267,6 @@ static netdev_tx_t kvaser_usb_start_xmit(struct sk_buff *skb,
buf = kmalloc(sizeof(struct kvaser_msg), GFP_ATOMIC); buf = kmalloc(sizeof(struct kvaser_msg), GFP_ATOMIC);
if (!buf) { if (!buf) {
netdev_err(netdev, "No memory left for USB buffer\n");
stats->tx_dropped++; stats->tx_dropped++;
goto nobufmem; goto nobufmem;
} }
......
...@@ -386,7 +386,6 @@ static int peak_usb_start(struct peak_usb_device *dev) ...@@ -386,7 +386,6 @@ static int peak_usb_start(struct peak_usb_device *dev)
buf = kmalloc(dev->adapter->rx_buffer_size, GFP_KERNEL); buf = kmalloc(dev->adapter->rx_buffer_size, GFP_KERNEL);
if (!buf) { if (!buf) {
netdev_err(netdev, "No memory left for USB buffer\n");
usb_free_urb(urb); usb_free_urb(urb);
err = -ENOMEM; err = -ENOMEM;
break; break;
...@@ -442,7 +441,6 @@ static int peak_usb_start(struct peak_usb_device *dev) ...@@ -442,7 +441,6 @@ static int peak_usb_start(struct peak_usb_device *dev)
buf = kmalloc(dev->adapter->tx_buffer_size, GFP_KERNEL); buf = kmalloc(dev->adapter->tx_buffer_size, GFP_KERNEL);
if (!buf) { if (!buf) {
netdev_err(netdev, "No memory left for USB buffer\n");
usb_free_urb(urb); usb_free_urb(urb);
err = -ENOMEM; err = -ENOMEM;
break; break;
...@@ -634,7 +632,6 @@ static int peak_usb_restart(struct peak_usb_device *dev) ...@@ -634,7 +632,6 @@ static int peak_usb_restart(struct peak_usb_device *dev)
/* also allocate enough space for the commands to send */ /* also allocate enough space for the commands to send */
buf = kmalloc(PCAN_USB_MAX_CMD_LEN, GFP_ATOMIC); buf = kmalloc(PCAN_USB_MAX_CMD_LEN, GFP_ATOMIC);
if (!buf) { if (!buf) {
netdev_err(dev->netdev, "no memory left for async cmd\n");
usb_free_urb(urb); usb_free_urb(urb);
return -ENOMEM; return -ENOMEM;
} }
...@@ -729,8 +726,6 @@ static int peak_usb_create_dev(struct peak_usb_adapter *peak_usb_adapter, ...@@ -729,8 +726,6 @@ static int peak_usb_create_dev(struct peak_usb_adapter *peak_usb_adapter,
/* allocate a buffer large enough to send commands */ /* allocate a buffer large enough to send commands */
dev->cmd_buf = kmalloc(PCAN_USB_MAX_CMD_LEN, GFP_KERNEL); dev->cmd_buf = kmalloc(PCAN_USB_MAX_CMD_LEN, GFP_KERNEL);
if (!dev->cmd_buf) { if (!dev->cmd_buf) {
dev_err(&intf->dev, "%s: couldn't alloc cmd buffer\n",
PCAN_USB_DRIVER_NAME);
err = -ENOMEM; err = -ENOMEM;
goto lbl_set_intf_data; goto lbl_set_intf_data;
} }
......
...@@ -958,10 +958,8 @@ static int usb_8dev_probe(struct usb_interface *intf, ...@@ -958,10 +958,8 @@ static int usb_8dev_probe(struct usb_interface *intf,
priv->cmd_msg_buffer = kzalloc(sizeof(struct usb_8dev_cmd_msg), priv->cmd_msg_buffer = kzalloc(sizeof(struct usb_8dev_cmd_msg),
GFP_KERNEL); GFP_KERNEL);
if (!priv->cmd_msg_buffer) { if (!priv->cmd_msg_buffer)
netdev_err(netdev, "Couldn't alloc Tx buffer\n");
goto cleanup_candev; goto cleanup_candev;
}
usb_set_intfdata(intf, priv); usb_set_intfdata(intf, priv);
......
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