]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
USB: cdc-acm: fix double free on probe failure
authorJohan Hovold <johan@kernel.org>
Mon, 22 Mar 2021 15:53:11 +0000 (16:53 +0100)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 8 Apr 2021 20:42:53 +0000 (15:42 -0500)
commit821fdb8364ef33f298d4417da59f53b24e85e3bd
treef5a83c90ed537132831555ee85926d52d43c23ff
parent1ca3c48d1d22b0c4b28a7299290e4ae4600cf64a
USB: cdc-acm: fix double free on probe failure

BugLink: https://bugs.launchpad.net/bugs/1923069
commit 7180495cb3d0e2a2860d282a468b4146c21da78f upstream.

If tty-device registration fails the driver copy of any Country
Selection functional descriptor would end up being freed twice; first
explicitly in the error path and then again in the tty-port destructor.

Drop the first erroneous free that was left when fixing a tty-port
resource leak.

Fixes: cae2bc768d17 ("usb: cdc-acm: Decrement tty port's refcount if probe() fail")
Cc: stable@vger.kernel.org # 4.19
Cc: Jaejoong Kim <climbbb.kim@gmail.com>
Acked-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20210322155318.9837-2-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
drivers/usb/class/cdc-acm.c