Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ed6590a861a16276db34ee626375fa79f3369ac3 Commit: ed6590a861a16276db34ee626375fa79f3369ac3 Parent: 0e66fb3492442faa17fc7f27a3eba35b3c811e38 Author: Oliver Neukum <[EMAIL PROTECTED]> AuthorDate: Mon Sep 17 20:15:53 2007 +0200 Committer: Greg Kroah-Hartman <[EMAIL PROTECTED]> CommitDate: Fri Oct 12 14:55:26 2007 -0700
USB: fix double frees in error code paths of ipaq driver the error code paths can be enter with buffers to freed buffers. Serial core would do a kfree() on memory already freed. Signed-off-by: Oliver Neukum <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- drivers/usb/serial/ipaq.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/usb/serial/ipaq.c b/drivers/usb/serial/ipaq.c index 6a3a704..c1a6484 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) kfree(port->bulk_out_buffer); port->bulk_in_buffer = kmalloc(URBDATA_SIZE, GFP_KERNEL); if (port->bulk_in_buffer == NULL) { + port->bulk_out_buffer = NULL; /* prevent double free */ goto enomem; } port->bulk_out_buffer = kmalloc(URBDATA_SIZE, GFP_KERNEL); if (port->bulk_out_buffer == NULL) { kfree(port->bulk_in_buffer); + port->bulk_in_buffer = NULL; goto enomem; } port->read_urb->transfer_buffer = port->bulk_in_buffer; - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html