mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Oliver Hartkopp <socketcan@hartkopp.net>
To: Ian Rogers <irogers@google.com>,
	Marc Kleine-Budde <mkl@pengutronix.de>,
	Vincent Mailhol <mailhol@kernel.org>
Cc: linux-can@vger.kernel.org, linux-kernel@vger.kernel.org,
	llvm@lists.linux.dev, Elkin Cruz <elkin@google.com>
Subject: Re: [PATCH] can: softing: lock card->fw.lock unconditionally in softing_card_shutdown()
Date: Thu, 19 Nov 2026 18:26:25 +0100	[thread overview]
Message-ID: <b7b1b385-cec0-4828-aff4-d0ab5fd61951@hartkopp.net> (raw)
In-Reply-To: <20261119170722.1524088-1-irogers@google.com>

Hi Ian,

the PCMCIA Softing CANcard2 is discontinued since 2013 and the latest
Windows drivers date back to Windows 7/8.

The Softing CANcard driver is to be removed as there's no known user and 
we lack the access to this at least 25 y/o hardware for 10 years now:

https://lore.kernel.org/linux-can/20261118092955.1283165-11-mkl@pengutronix.de/

So thanks for your patch but unfortunately too late.

Btw. beware of Sashiko bot reviews for this obsolete patch that will 
make you rework the entire driver :-D

Best regards,
Oliver


On 19.11.26 18:07, Ian Rogers wrote:
> softing_card_shutdown() calls mutex_lock_interruptible(&card->fw.lock)
> with an empty if-body ('{ /* return -ERESTARTSYS */; }'). Because
> softing_pdev_remove() invokes softing_card_shutdown() before
> unregistering netdevs or removing sysfs attributes, a pending signal
> while card->fw.lock is contended causes mutex_lock_interruptible() to
> return -EINTR without acquiring the lock. Execution then proceeds unlocked
> through IRQ and DPRAM teardown and calls mutex_unlock(&card->fw.lock) on a
> mutex not owned by the current task.
> 
> Use mutex_lock(&card->fw.lock) in softing_card_shutdown().
> 
> Found via an x86_64 LLVM=1 (Clang 21.1.8) allyesconfig audit with
> -Wextra-semi-stmt enabled; fix and changelog drafted with an AI coding
> assistant. Build-tested under LLVM=1 W=1 (-Werror) and -Wextra-semi-stmt;
> not tested on Softing CAN hardware.
> 
> Fixes: 03fd3cf5a179 ("can: add driver for Softing card")
> Fixes: 47fa0336c1b7 ("can: softing: softing_card_shutdown(): add  braces around empty body in an 'if' statement")
> Signed-off-by: Ian Rogers <irogers@google.com>
> ---
>   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;
>   


  reply	other threads:[~2026-11-19 17:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-19 17:07 Ian Rogers
2026-11-19 17:26 ` Oliver Hartkopp [this message]
2026-11-19 17:27 ` Marc Kleine-Budde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b7b1b385-cec0-4828-aff4-d0ab5fd61951@hartkopp.net \
    --to=socketcan@hartkopp.net \
    --cc=elkin@google.com \
    --cc=irogers@google.com \
    --cc=linux-can@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=mailhol@kernel.org \
    --cc=mkl@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®