net: can: usb: peak_usb: pcan_usb_core: don't print error when allocating urb fails
authorWolfram Sang <wsa-dev@sang-engineering.com>
Thu, 11 Aug 2016 21:05:24 +0000 (23:05 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sat, 13 Aug 2016 21:53:39 +0000 (14:53 -0700)
kmalloc will print enough information in case of failure.

Signed-off-by: Wolfram Sang <wsa-dev@sang-engineering.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/can/usb/peak_usb/pcan_usb_core.c

index bfb91d8fa46056b9fc9d7d51dfd0dfc0ad251d89..c06382cdfdfee4d736ef9b86eb2ef33104a62b92 100644 (file)
@@ -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);