diff options
author | Wolfram Sang <wsa-dev@sang-engineering.com> | 2016-08-25 13:39:11 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-08-30 13:17:37 -0400 |
commit | a02b55c8db5a35059fda254a7a5bddacc9fd4cef (patch) | |
tree | a9a2c7ac081e70d3f2ae03fdd9c36b64a7bc5175 /drivers/usb | |
parent | f4c46f119ac6edbff2ec8ca8aad4beffc5631eac (diff) |
usb: misc: adutux: 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/adutux.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/usb/misc/adutux.c b/drivers/usb/misc/adutux.c index c34a0b6980cd..564268fca07a 100644 --- a/drivers/usb/misc/adutux.c +++ b/drivers/usb/misc/adutux.c | |||
@@ -672,8 +672,7 @@ static int adu_probe(struct usb_interface *interface, | |||
672 | 672 | ||
673 | /* allocate memory for our device state and initialize it */ | 673 | /* allocate memory for our device state and initialize it */ |
674 | dev = kzalloc(sizeof(struct adu_device), GFP_KERNEL); | 674 | dev = kzalloc(sizeof(struct adu_device), GFP_KERNEL); |
675 | if (dev == NULL) { | 675 | if (!dev) { |
676 | dev_err(&interface->dev, "Out of memory\n"); | ||
677 | retval = -ENOMEM; | 676 | retval = -ENOMEM; |
678 | goto exit; | 677 | goto exit; |
679 | } | 678 | } |
@@ -710,7 +709,6 @@ static int adu_probe(struct usb_interface *interface, | |||
710 | 709 | ||
711 | dev->read_buffer_primary = kmalloc((4 * in_end_size), GFP_KERNEL); | 710 | dev->read_buffer_primary = kmalloc((4 * in_end_size), GFP_KERNEL); |
712 | if (!dev->read_buffer_primary) { | 711 | if (!dev->read_buffer_primary) { |
713 | dev_err(&interface->dev, "Couldn't allocate read_buffer_primary\n"); | ||
714 | retval = -ENOMEM; | 712 | retval = -ENOMEM; |
715 | goto error; | 713 | goto error; |
716 | } | 714 | } |
@@ -723,7 +721,6 @@ static int adu_probe(struct usb_interface *interface, | |||
723 | 721 | ||
724 | dev->read_buffer_secondary = kmalloc((4 * in_end_size), GFP_KERNEL); | 722 | dev->read_buffer_secondary = kmalloc((4 * in_end_size), GFP_KERNEL); |
725 | if (!dev->read_buffer_secondary) { | 723 | if (!dev->read_buffer_secondary) { |
726 | dev_err(&interface->dev, "Couldn't allocate read_buffer_secondary\n"); | ||
727 | retval = -ENOMEM; | 724 | retval = -ENOMEM; |
728 | goto error; | 725 | goto error; |
729 | } | 726 | } |
@@ -735,10 +732,8 @@ static int adu_probe(struct usb_interface *interface, | |||
735 | memset(dev->read_buffer_secondary + (3 * in_end_size), 'h', in_end_size); | 732 | memset(dev->read_buffer_secondary + (3 * in_end_size), 'h', in_end_size); |
736 | 733 | ||
737 | dev->interrupt_in_buffer = kmalloc(in_end_size, GFP_KERNEL); | 734 | dev->interrupt_in_buffer = kmalloc(in_end_size, GFP_KERNEL); |
738 | if (!dev->interrupt_in_buffer) { | 735 | if (!dev->interrupt_in_buffer) |
739 | dev_err(&interface->dev, "Couldn't allocate interrupt_in_buffer\n"); | ||
740 | goto error; | 736 | goto error; |
741 | } | ||
742 | 737 | ||
743 | /* debug code prime the buffer */ | 738 | /* debug code prime the buffer */ |
744 | memset(dev->interrupt_in_buffer, 'i', in_end_size); | 739 | memset(dev->interrupt_in_buffer, 'i', in_end_size); |
@@ -747,10 +742,8 @@ static int adu_probe(struct usb_interface *interface, | |||
747 | if (!dev->interrupt_in_urb) | 742 | if (!dev->interrupt_in_urb) |
748 | goto error; | 743 | goto error; |
749 | dev->interrupt_out_buffer = kmalloc(out_end_size, GFP_KERNEL); | 744 | dev->interrupt_out_buffer = kmalloc(out_end_size, GFP_KERNEL); |
750 | if (!dev->interrupt_out_buffer) { | 745 | if (!dev->interrupt_out_buffer) |
751 | dev_err(&interface->dev, "Couldn't allocate interrupt_out_buffer\n"); | ||
752 | goto error; | 746 | goto error; |
753 | } | ||
754 | dev->interrupt_out_urb = usb_alloc_urb(0, GFP_KERNEL); | 747 | dev->interrupt_out_urb = usb_alloc_urb(0, GFP_KERNEL); |
755 | if (!dev->interrupt_out_urb) | 748 | if (!dev->interrupt_out_urb) |
756 | goto error; | 749 | goto error; |