Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 106458
b: refs/heads/master
c: 852fef6
h: refs/heads/master
v: v3
  • Loading branch information
Oliver Neukum authored and Linus Torvalds committed Jul 27, 2008
1 parent 2a9431a commit 95cae6d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9ee08c2df47c10ba624ff05a6c0f2500748bcb69
refs/heads/master: 852fef69c0d9510a28a70221cfddd004efa02552
10 changes: 6 additions & 4 deletions trunk/drivers/usb/serial/ipaq.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 95cae6d

Please sign in to comment.