Commit 2479204b authored by Wolfram Sang's avatar Wolfram Sang Committed by David S. Miller

net: can: usb: peak_usb: pcan_usb_core: don't print error when allocating urb fails

kmalloc will print enough information in case of failure.
Signed-off-by: default avatarWolfram Sang <wsa-dev@sang-engineering.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent bc1af47d
...@@ -399,7 +399,6 @@ static int peak_usb_start(struct peak_usb_device *dev) ...@@ -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 */ /* create a URB, and a buffer for it, to receive usb messages */
urb = usb_alloc_urb(0, GFP_KERNEL); urb = usb_alloc_urb(0, GFP_KERNEL);
if (!urb) { if (!urb) {
netdev_err(netdev, "No memory left for URBs\n");
err = -ENOMEM; err = -ENOMEM;
break; break;
} }
...@@ -454,7 +453,6 @@ static int peak_usb_start(struct peak_usb_device *dev) ...@@ -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 */ /* create a URB and a buffer for it, to transmit usb messages */
urb = usb_alloc_urb(0, GFP_KERNEL); urb = usb_alloc_urb(0, GFP_KERNEL);
if (!urb) { if (!urb) {
netdev_err(netdev, "No memory left for URBs\n");
err = -ENOMEM; err = -ENOMEM;
break; break;
} }
...@@ -651,10 +649,8 @@ static int peak_usb_restart(struct peak_usb_device *dev) ...@@ -651,10 +649,8 @@ static int peak_usb_restart(struct peak_usb_device *dev)
/* first allocate a urb to handle the asynchronous steps */ /* first allocate a urb to handle the asynchronous steps */
urb = usb_alloc_urb(0, GFP_ATOMIC); urb = usb_alloc_urb(0, GFP_ATOMIC);
if (!urb) { if (!urb)
netdev_err(dev->netdev, "no memory left for urb\n");
return -ENOMEM; return -ENOMEM;
}
/* 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);
......
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