diff options
author | Johan Hovold <jhovold@gmail.com> | 2010-05-13 15:02:00 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-05-20 16:21:45 -0400 |
commit | 2ff78c0c2b67120c8e503268da3f177cae2228a2 (patch) | |
tree | 4c57bfee9bf1501b4ace8008f2f8d8212a756a40 /drivers/usb/serial | |
parent | 16032c4f5b291af541e9114a09ea20ff5a0dc474 (diff) |
USB: ir-usb: fix double free
If the user specifies a custom bulk buffer size we get a double free at
port release.
Cc: stable <stable@kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/serial')
-rw-r--r-- | drivers/usb/serial/ir-usb.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/usb/serial/ir-usb.c b/drivers/usb/serial/ir-usb.c index 4a0f51974232..71bdbe06baff 100644 --- a/drivers/usb/serial/ir-usb.c +++ b/drivers/usb/serial/ir-usb.c | |||
@@ -312,6 +312,7 @@ static int ir_open(struct tty_struct *tty, struct usb_serial_port *port) | |||
312 | kfree(port->read_urb->transfer_buffer); | 312 | kfree(port->read_urb->transfer_buffer); |
313 | port->read_urb->transfer_buffer = buffer; | 313 | port->read_urb->transfer_buffer = buffer; |
314 | port->read_urb->transfer_buffer_length = buffer_size; | 314 | port->read_urb->transfer_buffer_length = buffer_size; |
315 | port->bulk_in_buffer = buffer; | ||
315 | 316 | ||
316 | buffer = kmalloc(buffer_size, GFP_KERNEL); | 317 | buffer = kmalloc(buffer_size, GFP_KERNEL); |
317 | if (!buffer) { | 318 | if (!buffer) { |
@@ -321,6 +322,7 @@ static int ir_open(struct tty_struct *tty, struct usb_serial_port *port) | |||
321 | kfree(port->write_urb->transfer_buffer); | 322 | kfree(port->write_urb->transfer_buffer); |
322 | port->write_urb->transfer_buffer = buffer; | 323 | port->write_urb->transfer_buffer = buffer; |
323 | port->write_urb->transfer_buffer_length = buffer_size; | 324 | port->write_urb->transfer_buffer_length = buffer_size; |
325 | port->bulk_out_buffer = buffer; | ||
324 | port->bulk_out_size = buffer_size; | 326 | port->bulk_out_size = buffer_size; |
325 | } | 327 | } |
326 | 328 | ||