mirror of
https://github.com/torvalds/linux.git
synced 2024-11-26 06:02:05 +00:00
can: mcp251x: mcp251x_restart_work_handler(): Fix potential force_quit race condition
In mcp251x_restart_work_handler() the variable to stop the interrupt handler (priv->force_quit) is reset after the chip is restarted and thus a interrupt might occur. This patch fixes the potential race condition by resetting force_quit before enabling interrupts. Signed-off-by: Timo Schlüßler <schluessler@krause.de> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This commit is contained in:
parent
688d11c384
commit
27a0e54bae
@ -717,6 +717,7 @@ static void mcp251x_restart_work_handler(struct work_struct *ws)
|
||||
if (priv->after_suspend) {
|
||||
mcp251x_hw_reset(spi);
|
||||
mcp251x_setup(net, spi);
|
||||
priv->force_quit = 0;
|
||||
if (priv->after_suspend & AFTER_SUSPEND_RESTART) {
|
||||
mcp251x_set_normal_mode(spi);
|
||||
} else if (priv->after_suspend & AFTER_SUSPEND_UP) {
|
||||
@ -728,7 +729,6 @@ static void mcp251x_restart_work_handler(struct work_struct *ws)
|
||||
mcp251x_hw_sleep(spi);
|
||||
}
|
||||
priv->after_suspend = 0;
|
||||
priv->force_quit = 0;
|
||||
}
|
||||
|
||||
if (priv->restart_tx) {
|
||||
|
Loading…
Reference in New Issue
Block a user