Skip to content

Commit

Permalink
USB: mos7840: fix port-device leak in error path
Browse files Browse the repository at this point in the history
The driver set the usb-serial port pointers to NULL on errors in attach,
effectively preventing usb-serial core from decrementing the port ref
counters and releasing the port devices and associated data.

Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Johan Hovold authored and Greg Kroah-Hartman committed Oct 25, 2012
1 parent 65a4cdb commit 3eb55cc
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion drivers/usb/serial/mos7840.c
Original file line number Diff line number Diff line change
Expand Up @@ -2587,7 +2587,6 @@ static int mos7840_startup(struct usb_serial *serial)
kfree(mos7840_port->ctrl_buf);
usb_free_urb(mos7840_port->control_urb);
kfree(mos7840_port);
serial->port[i] = NULL;
}
return status;
}
Expand Down

0 comments on commit 3eb55cc

Please sign in to comment.