1
0
Fork 0
alistair23-linux/drivers/usb/roles
Wen Yang 76d915a1b1 usb: roles: fix a potential use after free
commit 1848a54319 upstream.

Free the sw structure only after we are done using it.
This patch just moves the put_device() down a bit to avoid the
use after free.

Fixes: 5c54fcac9a ("usb: roles: Take care of driver module reference counting")
Signed-off-by: Wen Yang <wenyang@linux.alibaba.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: Peter Chen <peter.chen@nxp.com>
Cc: stable <stable@vger.kernel.org>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Chunfeng Yun <chunfeng.yun@mediatek.com>
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
Cc: linux-usb@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Link: https://lore.kernel.org/r/20191124142236.25671-1-wenyang@linux.alibaba.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-12-17 19:55:46 +01:00
..
Kconfig USB: add missing SPDX lines to Kconfig and Makefiles 2019-01-22 09:08:17 +01:00
Makefile USB: add missing SPDX lines to Kconfig and Makefiles 2019-01-22 09:08:17 +01:00
class.c usb: roles: fix a potential use after free 2019-12-17 19:55:46 +01:00
intel-xhci-usb-role-switch.c USB changes for 5.4-rc1 2019-09-18 10:33:46 -07:00