Commit a02b55c8 authored by Wolfram Sang's avatar Wolfram Sang Committed by Greg Kroah-Hartman

usb: misc: adutux: don't print on ENOMEM

All kmalloc-based functions print enough information on failures.
Signed-off-by: default avatarWolfram Sang <wsa-dev@sang-engineering.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f4c46f11
...@@ -672,8 +672,7 @@ static int adu_probe(struct usb_interface *interface, ...@@ -672,8 +672,7 @@ static int adu_probe(struct usb_interface *interface,
/* allocate memory for our device state and initialize it */ /* allocate memory for our device state and initialize it */
dev = kzalloc(sizeof(struct adu_device), GFP_KERNEL); dev = kzalloc(sizeof(struct adu_device), GFP_KERNEL);
if (dev == NULL) { if (!dev) {
dev_err(&interface->dev, "Out of memory\n");
retval = -ENOMEM; retval = -ENOMEM;
goto exit; goto exit;
} }
...@@ -710,7 +709,6 @@ static int adu_probe(struct usb_interface *interface, ...@@ -710,7 +709,6 @@ static int adu_probe(struct usb_interface *interface,
dev->read_buffer_primary = kmalloc((4 * in_end_size), GFP_KERNEL); dev->read_buffer_primary = kmalloc((4 * in_end_size), GFP_KERNEL);
if (!dev->read_buffer_primary) { if (!dev->read_buffer_primary) {
dev_err(&interface->dev, "Couldn't allocate read_buffer_primary\n");
retval = -ENOMEM; retval = -ENOMEM;
goto error; goto error;
} }
...@@ -723,7 +721,6 @@ static int adu_probe(struct usb_interface *interface, ...@@ -723,7 +721,6 @@ static int adu_probe(struct usb_interface *interface,
dev->read_buffer_secondary = kmalloc((4 * in_end_size), GFP_KERNEL); dev->read_buffer_secondary = kmalloc((4 * in_end_size), GFP_KERNEL);
if (!dev->read_buffer_secondary) { if (!dev->read_buffer_secondary) {
dev_err(&interface->dev, "Couldn't allocate read_buffer_secondary\n");
retval = -ENOMEM; retval = -ENOMEM;
goto error; goto error;
} }
...@@ -735,10 +732,8 @@ static int adu_probe(struct usb_interface *interface, ...@@ -735,10 +732,8 @@ static int adu_probe(struct usb_interface *interface,
memset(dev->read_buffer_secondary + (3 * in_end_size), 'h', in_end_size); memset(dev->read_buffer_secondary + (3 * in_end_size), 'h', in_end_size);
dev->interrupt_in_buffer = kmalloc(in_end_size, GFP_KERNEL); dev->interrupt_in_buffer = kmalloc(in_end_size, GFP_KERNEL);
if (!dev->interrupt_in_buffer) { if (!dev->interrupt_in_buffer)
dev_err(&interface->dev, "Couldn't allocate interrupt_in_buffer\n");
goto error; goto error;
}
/* debug code prime the buffer */ /* debug code prime the buffer */
memset(dev->interrupt_in_buffer, 'i', in_end_size); memset(dev->interrupt_in_buffer, 'i', in_end_size);
...@@ -747,10 +742,8 @@ static int adu_probe(struct usb_interface *interface, ...@@ -747,10 +742,8 @@ static int adu_probe(struct usb_interface *interface,
if (!dev->interrupt_in_urb) if (!dev->interrupt_in_urb)
goto error; goto error;
dev->interrupt_out_buffer = kmalloc(out_end_size, GFP_KERNEL); dev->interrupt_out_buffer = kmalloc(out_end_size, GFP_KERNEL);
if (!dev->interrupt_out_buffer) { if (!dev->interrupt_out_buffer)
dev_err(&interface->dev, "Couldn't allocate interrupt_out_buffer\n");
goto error; goto error;
}
dev->interrupt_out_urb = usb_alloc_urb(0, GFP_KERNEL); dev->interrupt_out_urb = usb_alloc_urb(0, GFP_KERNEL);
if (!dev->interrupt_out_urb) if (!dev->interrupt_out_urb)
goto error; goto error;
......
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