[PATCH] can: softing: Fix locking in softing_card_shutdown()
From: Bart Van Assche
Date: Mon Oct 26 2026 - 15:47:30 EST
If mutex_lock_interruptible() fails, softing_card_shutdown() goes on
without holding card->fw.lock and later unlocks that mutex anyway.
Shutting down cannot fail, so use mutex_lock() instead. This makes
sure the firmware state is always changed with fw.lock held and that
only a held mutex is unlocked.
Fixes: 03fd3cf5a179 ("can: add driver for Softing card")
Signed-off-by: Bart Van Assche <bvanassche@xxxxxxx>
---
drivers/net/can/softing/softing_main.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/net/can/softing/softing_main.c b/drivers/net/can/softing/softing_main.c
index 519ab3097f86..d3dfad4f5321 100644
--- a/drivers/net/can/softing/softing_main.c
+++ b/drivers/net/can/softing/softing_main.c
@@ -448,9 +448,7 @@ static void softing_card_shutdown(struct softing *card)
{
int fw_up = 0;
- if (mutex_lock_interruptible(&card->fw.lock)) {
- /* return -ERESTARTSYS */;
- }
+ mutex_lock(&card->fw.lock);
fw_up = card->fw.up;
card->fw.up = 0;