All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: btintel_pcie: fix double free of IRQ in remove()
@ 2026-08-14  9:28 Gongwei Li
  2026-08-14 10:54 ` bluez.test.bot
  0 siblings, 1 reply; 2+ messages in thread
From: Gongwei Li @ 2026-08-14  9:28 UTC (permalink / raw)
  To: Marcel Holtmann, Luiz Augusto von Dentz
  Cc: Kiran K, linux-bluetooth, linux-kernel, Gongwei Li, stable

From: Gongwei Li <ligongwei@kylinos.cn>

The MSI-X IRQs are requested with devm_request_threaded_irq() in
btintel_pcie_setup_irq(), but btintel_pcie_remove() releases them
explicitly with free_irq() and then calls pci_free_irq_vectors().

After .remove() returns, the driver core releases the remaining devm
resources of the device, which calls free_irq() a second time on the
vectors that were already freed and whose MSI-X interrupt domain has
already been destroyed by pci_free_irq_vectors(), resulting in
splats like:

  Trying to free already-free IRQ <n>

Fix this by using devm_free_irq(), which unregisters the devres
entry and then frees the IRQ, keeping the free order introduced by
the commit below intact: the IRQs are still released before
pci_free_irq_vectors() and no double free happens on devm cleanup.

Fixes: 041677e7aad6 ("Bluetooth: btintel_pcie: Fix irq leak")
Cc: stable@vger.kernel.org
Signed-off-by: Gongwei Li <ligongwei@kylinos.cn>
---
 drivers/bluetooth/btintel_pcie.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bluetooth/btintel_pcie.c b/drivers/bluetooth/btintel_pcie.c
index 2b7231be5973..8fc4b8e3e4e1 100644
--- a/drivers/bluetooth/btintel_pcie.c
+++ b/drivers/bluetooth/btintel_pcie.c
@@ -2966,7 +2966,7 @@ static void btintel_pcie_remove(struct pci_dev *pdev)
 		struct msix_entry *msix_entry;
 
 		msix_entry = &data->msix_entries[i];
-		free_irq(msix_entry->vector, msix_entry);
+		devm_free_irq(&pdev->dev, msix_entry->vector, msix_entry);
 	}
 
 	pci_free_irq_vectors(pdev);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-08-14 10:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-14  9:28 [PATCH] Bluetooth: btintel_pcie: fix double free of IRQ in remove() Gongwei Li
2026-08-14 10:54 ` bluez.test.bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.