Skip to content

Commit 0668e8c

Browse files
Yang Yingliangthierryreding
authored andcommitted
hte: Fix possible use-after-free in tegra_hte_test_remove()
del_timer() does not wait until the timer handler finishing. This means that the timer handler may still be running after the driver's remove function has finished, which would result in a use-after-free. Fix it by calling del_timer_sync(), which makes sure the timer handler has finished. Reported-by: Hulk Robot <[email protected]> Signed-off-by: Yang Yingliang <[email protected]> Reviewed-by: Dipen Patel <[email protected]> Acked-by: Dipen Patel <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
1 parent e0bfb57 commit 0668e8c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/hte/hte-tegra194-test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ static int tegra_hte_test_remove(struct platform_device *pdev)
219219
free_irq(hte.gpio_in_irq, &hte);
220220
gpiod_put(hte.gpio_in);
221221
gpiod_put(hte.gpio_out);
222-
del_timer(&hte.timer);
222+
del_timer_sync(&hte.timer);
223223

224224
return 0;
225225
}

0 commit comments

Comments
 (0)