aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/serial')
-rw-r--r--drivers/usb/serial/ipaq.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/usb/serial/ipaq.c b/drivers/usb/serial/ipaq.c
index 6a3a704b5849..c1a6484f6524 100644
--- a/drivers/usb/serial/ipaq.c
+++ b/drivers/usb/serial/ipaq.c
@@ -646,11 +646,13 @@ static int ipaq_open(struct usb_serial_port *port, struct file *filp)
646 kfree(port->bulk_out_buffer); 646 kfree(port->bulk_out_buffer);
647 port->bulk_in_buffer = kmalloc(URBDATA_SIZE, GFP_KERNEL); 647 port->bulk_in_buffer = kmalloc(URBDATA_SIZE, GFP_KERNEL);
648 if (port->bulk_in_buffer == NULL) { 648 if (port->bulk_in_buffer == NULL) {
649 port->bulk_out_buffer = NULL; /* prevent double free */
649 goto enomem; 650 goto enomem;
650 } 651 }
651 port->bulk_out_buffer = kmalloc(URBDATA_SIZE, GFP_KERNEL); 652 port->bulk_out_buffer = kmalloc(URBDATA_SIZE, GFP_KERNEL);
652 if (port->bulk_out_buffer == NULL) { 653 if (port->bulk_out_buffer == NULL) {
653 kfree(port->bulk_in_buffer); 654 kfree(port->bulk_in_buffer);
655 port->bulk_in_buffer = NULL;
654 goto enomem; 656 goto enomem;
655 } 657 }
656 port->read_urb->transfer_buffer = port->bulk_in_buffer; 658 port->read_urb->transfer_buffer = port->bulk_in_buffer;