|
@@ -289,8 +289,11 @@ static int opticon_write(struct tty_struct *tty, struct usb_serial_port *port,
|
|
/* The conncected devices do not have a bulk write endpoint,
|
|
/* The conncected devices do not have a bulk write endpoint,
|
|
* to transmit data to de barcode device the control endpoint is used */
|
|
* to transmit data to de barcode device the control endpoint is used */
|
|
dr = kmalloc(sizeof(struct usb_ctrlrequest), GFP_NOIO);
|
|
dr = kmalloc(sizeof(struct usb_ctrlrequest), GFP_NOIO);
|
|
- if (!dr)
|
|
|
|
- return -ENOMEM;
|
|
|
|
|
|
+ if (!dr) {
|
|
|
|
+ dev_err(&port->dev, "out of memory\n");
|
|
|
|
+ count = -ENOMEM;
|
|
|
|
+ goto error;
|
|
|
|
+ }
|
|
|
|
|
|
dr->bRequestType = USB_TYPE_VENDOR | USB_RECIP_INTERFACE | USB_DIR_OUT;
|
|
dr->bRequestType = USB_TYPE_VENDOR | USB_RECIP_INTERFACE | USB_DIR_OUT;
|
|
dr->bRequest = 0x01;
|
|
dr->bRequest = 0x01;
|