]> git.hungrycats.org Git - linux/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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Mar 2015 13:11:03 +0000 (14:11 +0100)
commit0db70c6d0c0d782ea2959278723a3d30bfa92de0
tree81e653443d01fffc7ef56a30a4fedaf128b7fea0
parentc1fdf10bac5b902687c8aa693fe70ff40051b4d3
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/serial/bus.c