From 95cae6de04da25a09126d4a2e4132703aa670336 Mon Sep 17 00:00:00 2001 From: Oliver Neukum Date: Sat, 26 Jul 2008 22:42:42 +0200 Subject: [PATCH] --- yaml --- r: 106458 b: refs/heads/master c: 852fef69c0d9510a28a70221cfddd004efa02552 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/usb/serial/ipaq.c | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 9a72b5f65c3b..c047bd357af0 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 9ee08c2df47c10ba624ff05a6c0f2500748bcb69 +refs/heads/master: 852fef69c0d9510a28a70221cfddd004efa02552 diff --git a/trunk/drivers/usb/serial/ipaq.c b/trunk/drivers/usb/serial/ipaq.c index 832a5a4f3cb3..cd9a2e138c8b 100644 --- a/trunk/drivers/usb/serial/ipaq.c +++ b/trunk/drivers/usb/serial/ipaq.c @@ -651,15 +651,17 @@ static int ipaq_open(struct tty_struct *tty, */ kfree(port->bulk_in_buffer); + kfree(port->bulk_out_buffer); + /* make sure the generic serial code knows */ + port->bulk_out_buffer = NULL; + port->bulk_in_buffer = kmalloc(URBDATA_SIZE, GFP_KERNEL); - if (port->bulk_in_buffer == NULL) { - port->bulk_out_buffer = NULL; /* prevent double free */ + if (port->bulk_in_buffer == NULL) goto enomem; - } - kfree(port->bulk_out_buffer); port->bulk_out_buffer = kmalloc(URBDATA_SIZE, GFP_KERNEL); if (port->bulk_out_buffer == NULL) { + /* the buffer is useless, free it */ kfree(port->bulk_in_buffer); port->bulk_in_buffer = NULL; goto enomem;