USB: serial: remove redundant allocation error messages

Failed allocations already get an OOM message and a stack dump.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Johan Hovold 2013-03-21 12:36:26 +01:00 committed by Greg Kroah-Hartman
parent d12e211d44
commit 6b03f7f79f

View File

@ -603,10 +603,8 @@ static struct usb_serial *create_serial(struct usb_device *dev,
struct usb_serial *serial; struct usb_serial *serial;
serial = kzalloc(sizeof(*serial), GFP_KERNEL); serial = kzalloc(sizeof(*serial), GFP_KERNEL);
if (!serial) { if (!serial)
dev_err(&dev->dev, "%s - out of memory\n", __func__);
return NULL; return NULL;
}
serial->dev = usb_get_dev(dev); serial->dev = usb_get_dev(dev);
serial->type = driver; serial->type = driver;
serial->interface = usb_get_intf(interface); serial->interface = usb_get_intf(interface);
@ -750,7 +748,6 @@ static int usb_serial_probe(struct usb_interface *interface,
serial = create_serial(dev, interface, type); serial = create_serial(dev, interface, type);
if (!serial) { if (!serial) {
module_put(type->driver.owner); module_put(type->driver.owner);
dev_err(ddev, "%s - out of memory\n", __func__);
return -ENOMEM; return -ENOMEM;
} }
@ -914,16 +911,12 @@ static int usb_serial_probe(struct usb_interface *interface,
for (j = 0; j < ARRAY_SIZE(port->read_urbs); ++j) { for (j = 0; j < ARRAY_SIZE(port->read_urbs); ++j) {
set_bit(j, &port->read_urbs_free); set_bit(j, &port->read_urbs_free);
port->read_urbs[j] = usb_alloc_urb(0, GFP_KERNEL); port->read_urbs[j] = usb_alloc_urb(0, GFP_KERNEL);
if (!port->read_urbs[j]) { if (!port->read_urbs[j])
dev_err(ddev, "No free urbs available\n");
goto probe_error; goto probe_error;
}
port->bulk_in_buffers[j] = kmalloc(buffer_size, port->bulk_in_buffers[j] = kmalloc(buffer_size,
GFP_KERNEL); GFP_KERNEL);
if (!port->bulk_in_buffers[j]) { if (!port->bulk_in_buffers[j])
dev_err(ddev, "Couldn't allocate bulk_in_buffer\n");
goto probe_error; goto probe_error;
}
usb_fill_bulk_urb(port->read_urbs[j], dev, usb_fill_bulk_urb(port->read_urbs[j], dev,
usb_rcvbulkpipe(dev, usb_rcvbulkpipe(dev,
endpoint->bEndpointAddress), endpoint->bEndpointAddress),
@ -950,16 +943,12 @@ static int usb_serial_probe(struct usb_interface *interface,
for (j = 0; j < ARRAY_SIZE(port->write_urbs); ++j) { for (j = 0; j < ARRAY_SIZE(port->write_urbs); ++j) {
set_bit(j, &port->write_urbs_free); set_bit(j, &port->write_urbs_free);
port->write_urbs[j] = usb_alloc_urb(0, GFP_KERNEL); port->write_urbs[j] = usb_alloc_urb(0, GFP_KERNEL);
if (!port->write_urbs[j]) { if (!port->write_urbs[j])
dev_err(ddev, "No free urbs available\n");
goto probe_error; goto probe_error;
}
port->bulk_out_buffers[j] = kmalloc(buffer_size, port->bulk_out_buffers[j] = kmalloc(buffer_size,
GFP_KERNEL); GFP_KERNEL);
if (!port->bulk_out_buffers[j]) { if (!port->bulk_out_buffers[j])
dev_err(ddev, "Couldn't allocate bulk_out_buffer\n");
goto probe_error; goto probe_error;
}
usb_fill_bulk_urb(port->write_urbs[j], dev, usb_fill_bulk_urb(port->write_urbs[j], dev,
usb_sndbulkpipe(dev, usb_sndbulkpipe(dev,
endpoint->bEndpointAddress), endpoint->bEndpointAddress),
@ -977,19 +966,15 @@ static int usb_serial_probe(struct usb_interface *interface,
endpoint = interrupt_in_endpoint[i]; endpoint = interrupt_in_endpoint[i];
port = serial->port[i]; port = serial->port[i];
port->interrupt_in_urb = usb_alloc_urb(0, GFP_KERNEL); port->interrupt_in_urb = usb_alloc_urb(0, GFP_KERNEL);
if (!port->interrupt_in_urb) { if (!port->interrupt_in_urb)
dev_err(ddev, "No free urbs available\n");
goto probe_error; goto probe_error;
}
buffer_size = usb_endpoint_maxp(endpoint); buffer_size = usb_endpoint_maxp(endpoint);
port->interrupt_in_endpointAddress = port->interrupt_in_endpointAddress =
endpoint->bEndpointAddress; endpoint->bEndpointAddress;
port->interrupt_in_buffer = kmalloc(buffer_size, port->interrupt_in_buffer = kmalloc(buffer_size,
GFP_KERNEL); GFP_KERNEL);
if (!port->interrupt_in_buffer) { if (!port->interrupt_in_buffer)
dev_err(ddev, "Couldn't allocate interrupt_in_buffer\n");
goto probe_error; goto probe_error;
}
usb_fill_int_urb(port->interrupt_in_urb, dev, usb_fill_int_urb(port->interrupt_in_urb, dev,
usb_rcvintpipe(dev, usb_rcvintpipe(dev,
endpoint->bEndpointAddress), endpoint->bEndpointAddress),
@ -1006,20 +991,16 @@ static int usb_serial_probe(struct usb_interface *interface,
endpoint = interrupt_out_endpoint[i]; endpoint = interrupt_out_endpoint[i];
port = serial->port[i]; port = serial->port[i];
port->interrupt_out_urb = usb_alloc_urb(0, GFP_KERNEL); port->interrupt_out_urb = usb_alloc_urb(0, GFP_KERNEL);
if (!port->interrupt_out_urb) { if (!port->interrupt_out_urb)
dev_err(ddev, "No free urbs available\n");
goto probe_error; goto probe_error;
}
buffer_size = usb_endpoint_maxp(endpoint); buffer_size = usb_endpoint_maxp(endpoint);
port->interrupt_out_size = buffer_size; port->interrupt_out_size = buffer_size;
port->interrupt_out_endpointAddress = port->interrupt_out_endpointAddress =
endpoint->bEndpointAddress; endpoint->bEndpointAddress;
port->interrupt_out_buffer = kmalloc(buffer_size, port->interrupt_out_buffer = kmalloc(buffer_size,
GFP_KERNEL); GFP_KERNEL);
if (!port->interrupt_out_buffer) { if (!port->interrupt_out_buffer)
dev_err(ddev, "Couldn't allocate interrupt_out_buffer\n");
goto probe_error; goto probe_error;
}
usb_fill_int_urb(port->interrupt_out_urb, dev, usb_fill_int_urb(port->interrupt_out_urb, dev,
usb_sndintpipe(dev, usb_sndintpipe(dev,
endpoint->bEndpointAddress), endpoint->bEndpointAddress),