[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200116173641.22137-30-sashal@kernel.org>
Date: Thu, 16 Jan 2020 12:33:39 -0500
From: Sasha Levin <sashal@...nel.org>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
Cc: Sven Van Asbroeck <thesven73@...il.com>,
Tony Lindgren <tony@...mide.com>, Bin Liu <b-liu@...com>,
Sven Van Asbroeck <TheSven73@...il.com>,
Felipe Balbi <felipe.balbi@...ux.intel.com>,
Sasha Levin <sashal@...nel.org>, linux-usb@...r.kernel.org
Subject: [PATCH AUTOSEL 4.9 070/251] usb: phy: twl6030-usb: fix possible use-after-free on remove
From: Sven Van Asbroeck <thesven73@...il.com>
[ 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@...mide.com>
Cc: Bin Liu <b-liu@...com>
Fixes: b6a619a883c3 ("usb: phy: Check initial state for twl6030")
Signed-off-by: Sven Van Asbroeck <TheSven73@...il.com>
Signed-off-by: Felipe Balbi <felipe.balbi@...ux.intel.com>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
drivers/usb/phy/phy-twl6030-usb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/phy/phy-twl6030-usb.c b/drivers/usb/phy/phy-twl6030-usb.c
index a72e8d670adc..cf0b67433ac9 100644
--- a/drivers/usb/phy/phy-twl6030-usb.c
+++ b/drivers/usb/phy/phy-twl6030-usb.c
@@ -422,7 +422,7 @@ static int twl6030_usb_remove(struct platform_device *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,
REG_INT_MSK_LINE_C);
twl6030_interrupt_mask(TWL6030_USBOTG_INT_MASK,
--
2.20.1
Powered by blists - more mailing lists