]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
usb: phy: twl6030-usb: fix possible use-after-free on remove
authorSven Van Asbroeck <thesven73@gmail.com>
Mon, 11 Feb 2019 15:04:26 +0000 (10:04 -0500)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 14 Feb 2020 05:29:37 +0000 (00:29 -0500)
commit409a4065f0ba1806d058ff1c201619cdfb4d18c4
tree76db198c2c68f2274d162aa10fcbd603108fab49
parentfb6825f02fca2a3c512b5a48dd069b95cc9ea449
usb: phy: twl6030-usb: fix possible use-after-free on remove

BugLink: https://bugs.launchpad.net/bugs/1863019
[ Upstream commit 5895d311d28f2605e2f71c1a3e043ed38f3ac9d2 ]

In remove(), use cancel_delayed_work_sync() to cancel the
delayed work. Otherwise there's a chance that this work
will continue to run until after the device has been removed.

This issue was detected with the help of Coccinelle.

Cc: Tony Lindgren <tony@atomide.com>
Cc: Bin Liu <b-liu@ti.com>
Fixes: b6a619a883c3 ("usb: phy: Check initial state for twl6030")
Signed-off-by: Sven Van Asbroeck <TheSven73@gmail.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/usb/phy/phy-twl6030-usb.c