OSDN Git Service

can: mcp251x: mcp251x_restart_work_handler(): Fix potential force_quit race condition
authorTimo Schlüßler <schluessler@krause.de>
Fri, 11 Oct 2019 13:38:19 +0000 (15:38 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Dec 2019 08:19:43 +0000 (09:19 +0100)
commit7302e7b10855e8512d406e2cb32916c71edb8936
tree85970634550c91207efdc410137a6091f148b44b
parent24e10fc2e0db64a87853f868f5c8dafac469ec8a
can: mcp251x: mcp251x_restart_work_handler(): Fix potential force_quit race condition

[ Upstream commit 27a0e54bae09d2dd023a01254db506d61cc50ba1 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/can/spi/mcp251x.c