mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-06 10:57:46 +00:00
usb: phy: twl6030-usb: fix possible use-after-free on remove
[ Upstream commit5895d311d2
] 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:b6a619a883
("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>
This commit is contained in:
parent
1dfd97f0b1
commit
fa7d3a65f3
1 changed files with 1 additions and 1 deletions
|
@ -400,7 +400,7 @@ static int twl6030_usb_remove(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct twl6030_usb *twl = platform_get_drvdata(pdev);
|
struct twl6030_usb *twl = platform_get_drvdata(pdev);
|
||||||
|
|
||||||
cancel_delayed_work(&twl->get_status_work);
|
cancel_delayed_work_sync(&twl->get_status_work);
|
||||||
twl6030_interrupt_mask(TWL6030_USBOTG_INT_MASK,
|
twl6030_interrupt_mask(TWL6030_USBOTG_INT_MASK,
|
||||||
REG_INT_MSK_LINE_C);
|
REG_INT_MSK_LINE_C);
|
||||||
twl6030_interrupt_mask(TWL6030_USBOTG_INT_MASK,
|
twl6030_interrupt_mask(TWL6030_USBOTG_INT_MASK,
|
||||||
|
|
Loading…
Reference in a new issue