From: Stanislaw Gruszka <stf_xl@wp.pl>
To: Zhao Li <enderaoelyther@gmail.com>
Cc: Wey-Yi Guy <wey-yi.w.guy@intel.com>,
linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH] wifi: iwlegacy: unregister the LED if 3945 hardware registration fails
Date: Thu, 29 Oct 2026 09:19:55 +0100 [thread overview]
Message-ID: <20261029081955.GA10212@wp.pl> (raw)
In-Reply-To: <20261028142328.18560-1-enderaoelyther@gmail.com>
Hi,
On Wed, Oct 28, 2026 at 10:23:28PM +0800, Zhao Li wrote:
> If ieee80211_register_hw() fails during 3945 setup, later LED callbacks
> can access hardware and driver state that probe has already freed.
>
> il3945_setup_mac() registers the LED before the mac80211 hardware, but
> its registration error path does not call il_leds_exit(). The analogous
> 4965 failure releases the driver and reaches its existing remove cleanup.
Could you explain exacly how this is fixed in 4965?
I do not see this in the code.
Regards
Stanislaw
> Unregister the 3945 LED before unwinding a failed hardware registration.
>
> LLM assistance was used to find the bug and review.
>
> Fixes: 5ed540aecc2a ("iwlwifi: use mac80211 throughput trigger")
> Cc: stable@vger.kernel.org
> Signed-off-by: Zhao Li <enderaoelyther@gmail.com>
> ---
> Validation: A W=1 module build with MODPOST passed. Not
> reproduced; 3945 hardware was unavailable.
> Sparse C=2 passed. Targeted Smatch introduced no new diagnostics.
>
> drivers/net/wireless/intel/iwlegacy/3945-mac.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/wireless/intel/iwlegacy/3945-mac.c b/drivers/net/wireless/intel/iwlegacy/3945-mac.c
> index f7ca182d1494..5e11f0597255 100644
> --- a/drivers/net/wireless/intel/iwlegacy/3945-mac.c
> +++ b/drivers/net/wireless/intel/iwlegacy/3945-mac.c
> @@ -3529,6 +3529,7 @@ il3945_setup_mac(struct il_priv *il)
> ret = ieee80211_register_hw(il->hw);
> if (ret) {
> IL_ERR("Failed to register hw (error %d)\n", ret);
> + il_leds_exit(il);
> return ret;
> }
> il->mac80211_registered = 1;
>
> base-commit: 25e73f1d6868c759c8eb56cad4e411692c5341b4
> --
> 2.56.0
>
next prev parent reply other threads:[~2026-10-29 8:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-28 14:23 [PATCH] wifi: iwlegacy: unregister the LED if 3945 hardware registration fails Zhao Li
2026-10-29 8:19 ` Stanislaw Gruszka [this message]
2026-10-29 9:43 ` Zhao Li
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=20261029081955.GA10212@wp.pl \
--to=stf_xl@wp.pl \
--cc=enderaoelyther@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=wey-yi.w.guy@intel.com \
/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