]> git.baikalelectronics.ru Git - kernel.git/commit
can: slcan: do not sleep with a spin lock held
authorDario Binacchi <dario.binacchi@amarulasolutions.com>
Fri, 15 Jul 2022 07:29:51 +0000 (09:29 +0200)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Tue, 19 Jul 2022 18:54:53 +0000 (20:54 +0200)
commitb3a0a81655276932cece4039431b10be68fdbaf0
treef92a57c38ca01ccce0379f399dd33e362bf38e05
parente4e8dab2c37668b56740b1c014d8ea50397328db
can: slcan: do not sleep with a spin lock held

We can't call close_candev() with a spin lock held, so release the lock
before calling it. After calling close_candev(), we can update the
fields of the private `struct can_priv' without having to acquire the
lock.

Fixes: b6a6f59f33f28 ("can: slcan: use CAN network device driver API")
Link: https://lore.kernel.org/linux-kernel/Ysrf1Yc5DaRGN1WE@xsang-OptiPlex-9020/
Link: https://lore.kernel.org/all/20220715072951.859586-1-dario.binacchi@amarulasolutions.com
Reported-by: kernel test robot <oliver.sang@intel.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/slcan/slcan-core.c