mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-28 20:37:27 +00:00
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>
This commit is contained in:
parent
16032c4f5b
commit
2ff78c0c2b
@ -312,6 +312,7 @@ static int ir_open(struct tty_struct *tty, struct usb_serial_port *port)
|
||||
kfree(port->read_urb->transfer_buffer);
|
||||
port->read_urb->transfer_buffer = buffer;
|
||||
port->read_urb->transfer_buffer_length = buffer_size;
|
||||
port->bulk_in_buffer = buffer;
|
||||
|
||||
buffer = kmalloc(buffer_size, GFP_KERNEL);
|
||||
if (!buffer) {
|
||||
@ -321,6 +322,7 @@ static int ir_open(struct tty_struct *tty, struct usb_serial_port *port)
|
||||
kfree(port->write_urb->transfer_buffer);
|
||||
port->write_urb->transfer_buffer = buffer;
|
||||
port->write_urb->transfer_buffer_length = buffer_size;
|
||||
port->bulk_out_buffer = buffer;
|
||||
port->bulk_out_size = buffer_size;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user