Unverified Commit 8e65ce01 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!9058 watchdog: Fix possible use-after-free by calling del_timer_sync()

parents 72bc2b6a decef165
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -301,7 +301,7 @@ static int lpc18xx_wdt_remove(struct platform_device *pdev)
	struct lpc18xx_wdt_dev *lpc18xx_wdt = platform_get_drvdata(pdev);

	dev_warn(&pdev->dev, "I quit now, hardware will probably reboot!\n");
	del_timer(&lpc18xx_wdt->timer);
	del_timer_sync(&lpc18xx_wdt->timer);

	watchdog_unregister_device(&lpc18xx_wdt->wdt_dev);
	clk_disable_unprepare(lpc18xx_wdt->wdt_clk);
+1 −1
Original line number Diff line number Diff line
@@ -170,7 +170,7 @@ static void wdt_startup(void)
static void wdt_turnoff(void)
{
	/* Stop the timer */
	del_timer(&timer);
	del_timer_sync(&timer);

	wdt_change(WDT_DISABLE);