diff options
author | Wolfram Sang <wsa-dev@sang-engineering.com> | 2016-08-25 13:39:19 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-08-30 13:17:38 -0400 |
commit | 49d8ffab82342904e22f156530649faff9e6baae (patch) | |
tree | c76470dfbeb7214f5c886736799b7490a29971c5 /drivers/usb | |
parent | 6714ffae751868e237d8f887eca1754d08ee814c (diff) |
usb: misc: legousbtower: don't print on ENOMEM
All kmalloc-based functions print enough information on failures.
Signed-off-by: Wolfram Sang <wsa-dev@sang-engineering.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/misc/legousbtower.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/drivers/usb/misc/legousbtower.c b/drivers/usb/misc/legousbtower.c index 52b41fb66792..ece9b3c1eaac 100644 --- a/drivers/usb/misc/legousbtower.c +++ b/drivers/usb/misc/legousbtower.c | |||
@@ -817,10 +817,8 @@ static int tower_probe (struct usb_interface *interface, const struct usb_device | |||
817 | 817 | ||
818 | dev = kmalloc (sizeof(struct lego_usb_tower), GFP_KERNEL); | 818 | dev = kmalloc (sizeof(struct lego_usb_tower), GFP_KERNEL); |
819 | 819 | ||
820 | if (dev == NULL) { | 820 | if (!dev) |
821 | dev_err(idev, "Out of memory\n"); | ||
822 | goto exit; | 821 | goto exit; |
823 | } | ||
824 | 822 | ||
825 | mutex_init(&dev->lock); | 823 | mutex_init(&dev->lock); |
826 | 824 | ||
@@ -871,23 +869,17 @@ static int tower_probe (struct usb_interface *interface, const struct usb_device | |||
871 | } | 869 | } |
872 | 870 | ||
873 | dev->read_buffer = kmalloc (read_buffer_size, GFP_KERNEL); | 871 | dev->read_buffer = kmalloc (read_buffer_size, GFP_KERNEL); |
874 | if (!dev->read_buffer) { | 872 | if (!dev->read_buffer) |
875 | dev_err(idev, "Couldn't allocate read_buffer\n"); | ||
876 | goto error; | 873 | goto error; |
877 | } | ||
878 | dev->interrupt_in_buffer = kmalloc (usb_endpoint_maxp(dev->interrupt_in_endpoint), GFP_KERNEL); | 874 | dev->interrupt_in_buffer = kmalloc (usb_endpoint_maxp(dev->interrupt_in_endpoint), GFP_KERNEL); |
879 | if (!dev->interrupt_in_buffer) { | 875 | if (!dev->interrupt_in_buffer) |
880 | dev_err(idev, "Couldn't allocate interrupt_in_buffer\n"); | ||
881 | goto error; | 876 | goto error; |
882 | } | ||
883 | dev->interrupt_in_urb = usb_alloc_urb(0, GFP_KERNEL); | 877 | dev->interrupt_in_urb = usb_alloc_urb(0, GFP_KERNEL); |
884 | if (!dev->interrupt_in_urb) | 878 | if (!dev->interrupt_in_urb) |
885 | goto error; | 879 | goto error; |
886 | dev->interrupt_out_buffer = kmalloc (write_buffer_size, GFP_KERNEL); | 880 | dev->interrupt_out_buffer = kmalloc (write_buffer_size, GFP_KERNEL); |
887 | if (!dev->interrupt_out_buffer) { | 881 | if (!dev->interrupt_out_buffer) |
888 | dev_err(idev, "Couldn't allocate interrupt_out_buffer\n"); | ||
889 | goto error; | 882 | goto error; |
890 | } | ||
891 | dev->interrupt_out_urb = usb_alloc_urb(0, GFP_KERNEL); | 883 | dev->interrupt_out_urb = usb_alloc_urb(0, GFP_KERNEL); |
892 | if (!dev->interrupt_out_urb) | 884 | if (!dev->interrupt_out_urb) |
893 | goto error; | 885 | goto error; |