Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Wolfram Sang and committed by
Greg Kroah-Hartman
a02b55c8 f4c46f11

+3 -10
+3 -10
drivers/usb/misc/adutux.c
··· 672 672 673 673 /* allocate memory for our device state and initialize it */ 674 674 dev = kzalloc(sizeof(struct adu_device), GFP_KERNEL); 675 - if (dev == NULL) { 676 - dev_err(&interface->dev, "Out of memory\n"); 675 + if (!dev) { 677 676 retval = -ENOMEM; 678 677 goto exit; 679 678 } ··· 709 710 710 711 dev->read_buffer_primary = kmalloc((4 * in_end_size), GFP_KERNEL); 711 712 if (!dev->read_buffer_primary) { 712 - dev_err(&interface->dev, "Couldn't allocate read_buffer_primary\n"); 713 713 retval = -ENOMEM; 714 714 goto error; 715 715 } ··· 721 723 722 724 dev->read_buffer_secondary = kmalloc((4 * in_end_size), GFP_KERNEL); 723 725 if (!dev->read_buffer_secondary) { 724 - dev_err(&interface->dev, "Couldn't allocate read_buffer_secondary\n"); 725 726 retval = -ENOMEM; 726 727 goto error; 727 728 } ··· 732 735 memset(dev->read_buffer_secondary + (3 * in_end_size), 'h', in_end_size); 733 736 734 737 dev->interrupt_in_buffer = kmalloc(in_end_size, GFP_KERNEL); 735 - if (!dev->interrupt_in_buffer) { 736 - dev_err(&interface->dev, "Couldn't allocate interrupt_in_buffer\n"); 738 + if (!dev->interrupt_in_buffer) 737 739 goto error; 738 - } 739 740 740 741 /* debug code prime the buffer */ 741 742 memset(dev->interrupt_in_buffer, 'i', in_end_size); ··· 742 747 if (!dev->interrupt_in_urb) 743 748 goto error; 744 749 dev->interrupt_out_buffer = kmalloc(out_end_size, GFP_KERNEL); 745 - if (!dev->interrupt_out_buffer) { 746 - dev_err(&interface->dev, "Couldn't allocate interrupt_out_buffer\n"); 750 + if (!dev->interrupt_out_buffer) 747 751 goto error; 748 - } 749 752 dev->interrupt_out_urb = usb_alloc_urb(0, GFP_KERNEL); 750 753 if (!dev->interrupt_out_urb) 751 754 goto error;