usb: misc: usblcd: 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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
58e61402c7
commit
a1841732e0
@ -321,10 +321,8 @@ static int lcd_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(*dev), GFP_KERNEL);
|
dev = kzalloc(sizeof(*dev), GFP_KERNEL);
|
||||||
if (dev == NULL) {
|
if (!dev)
|
||||||
dev_err(&interface->dev, "Out of memory\n");
|
|
||||||
goto error;
|
goto error;
|
||||||
}
|
|
||||||
kref_init(&dev->kref);
|
kref_init(&dev->kref);
|
||||||
sema_init(&dev->limit_sem, USB_LCD_CONCURRENT_WRITES);
|
sema_init(&dev->limit_sem, USB_LCD_CONCURRENT_WRITES);
|
||||||
init_usb_anchor(&dev->submitted);
|
init_usb_anchor(&dev->submitted);
|
||||||
@ -351,11 +349,8 @@ static int lcd_probe(struct usb_interface *interface,
|
|||||||
dev->bulk_in_size = buffer_size;
|
dev->bulk_in_size = buffer_size;
|
||||||
dev->bulk_in_endpointAddr = endpoint->bEndpointAddress;
|
dev->bulk_in_endpointAddr = endpoint->bEndpointAddress;
|
||||||
dev->bulk_in_buffer = kmalloc(buffer_size, GFP_KERNEL);
|
dev->bulk_in_buffer = kmalloc(buffer_size, GFP_KERNEL);
|
||||||
if (!dev->bulk_in_buffer) {
|
if (!dev->bulk_in_buffer)
|
||||||
dev_err(&interface->dev,
|
|
||||||
"Could not allocate bulk_in_buffer\n");
|
|
||||||
goto error;
|
goto error;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!dev->bulk_out_endpointAddr &&
|
if (!dev->bulk_out_endpointAddr &&
|
||||||
|
Reference in New Issue
Block a user