]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
USB: serial: fix potential use-after-free after failed probe
authorJohan Hovold <johan@kernel.org>
Wed, 18 Feb 2015 03:34:50 +0000 (10:34 +0700)
committerSasha Levin <sasha.levin@oracle.com>
Sat, 14 Mar 2015 19:37:26 +0000 (15:37 -0400)
commitacc69639af028cb6e2a74d66a1dea931c9ea17b2
tree437532a809f4a91c771ea9a06c9ddccce363ea74
parent2e52da5fbf6d34bb496986d408ccb8eaf93800ff
USB: serial: fix potential use-after-free after failed probe

commit 07fdfc5e9f1c966be8722e8fa927e5ea140df5ce upstream.

Fix return value in probe error path, which could end up returning
success (0) on errors. This could in turn lead to use-after-free or
double free (e.g. in port_remove) when the port device is removed.

Fixes: c706ebdfc895 ("USB: usb-serial: call port_probe and port_remove
at the right times")
Signed-off-by: Johan Hovold <johan@kernel.org>
Acked-by: Greg Kroah-Hartman <greg@kroah.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
drivers/usb/serial/bus.c