mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiale Yao <yaojiale02@163.com>
To: Stanislav Yakovlev <stas.yakovlev@gmail.com>,
	linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: stable@vger.kernel.org
Subject: [PATCH 1/2] wifi: ipw2100: drain IRQ tasklet during teardown
Date: Wed, 28 Oct 2026 12:56:01 +0800	[thread overview]
Message-ID: <20261028045602.111668-2-yaojiale02@163.com> (raw)
In-Reply-To: <20261028045602.111668-1-yaojiale02@163.com>

The interrupt handler can queue irq_tasklet immediately before teardown
frees the IRQ.  free_irq() prevents new hard IRQ handlers, but it does
not drain a tasklet that was already queued.  The tasklet can therefore
access queues or MMIO after the remove and probe failure paths release
them.

Kill the tasklet after freeing the IRQ and before releasing resources it
can access.

Fixes: 2c86c275015c ("Add ipw2100 wireless driver.")
Cc: stable@vger.kernel.org
Signed-off-by: Jiale Yao <yaojiale02@163.com>
---
 drivers/net/wireless/intel/ipw2x00/ipw2100.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/intel/ipw2x00/ipw2100.c b/drivers/net/wireless/intel/ipw2x00/ipw2100.c
index 43b4e432956b..44c76f1789d2 100644
--- a/drivers/net/wireless/intel/ipw2x00/ipw2100.c
+++ b/drivers/net/wireless/intel/ipw2x00/ipw2100.c
@@ -6300,6 +6300,7 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev,
 
 		if (dev->irq)
 			free_irq(dev->irq, priv);
+		tasklet_kill(&priv->irq_tasklet);
 
 		ipw2100_kill_works(priv);
 
@@ -6346,6 +6347,9 @@ static void ipw2100_pci_remove_one(struct pci_dev *pci_dev)
 	 * FIXME: remove the comment above. */
 	unregister_netdev(dev);
 
+	free_irq(dev->irq, priv);
+	tasklet_kill(&priv->irq_tasklet);
+
 	ipw2100_kill_works(priv);
 
 	ipw2100_queues_free(priv);
@@ -6353,8 +6357,6 @@ static void ipw2100_pci_remove_one(struct pci_dev *pci_dev)
 	/* Free potential debugging firmware snapshot */
 	ipw2100_snapshot_free(priv);
 
-	free_irq(dev->irq, priv);
-
 	pci_iounmap(pci_dev, priv->ioaddr);
 
 	/* wiphy_unregister needs to be here, before free_libipw */
-- 
2.34.1


  reply	other threads:[~2026-10-28  4:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-28  4:56 [PATCH 0/2] wifi: ipw2x00: drain IRQ tasklets " Jiale Yao
2026-10-28  4:56 ` Jiale Yao [this message]
2026-10-28  4:56 ` [PATCH 2/2] wifi: ipw2200: drain IRQ tasklet " Jiale Yao

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=20261028045602.111668-2-yaojiale02@163.com \
    --to=yaojiale02@163.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=stas.yakovlev@gmail.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

all inboxes | Powered by JetHome®