Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH v1] Bluetooth: btintel_pcie: Fix null pointer dereference in remove
@ 2026-06-01 10:26 Chandrashekar Devegowda
  2026-06-01 12:47 ` [v1] " bluez.test.bot
  2026-06-01 19:10 ` [PATCH v1] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ messages in thread
From: Chandrashekar Devegowda @ 2026-06-01 10:26 UTC (permalink / raw)
  To: linux-bluetooth
  Cc: linux-pci, bhelgaas, ravishankar.srivatsa, chethan.tumkur.narayan,
	Chandrashekar Devegowda

Add a NULL check for pci_get_drvdata() in btintel_pcie_remove() to
prevent a null pointer dereference. This can occur when
btintel_pcie_remove() is called concurrently from the PLDR
device_reprobe path on another CPU, after pci_set_drvdata(pdev, NULL)
has already been executed.

Fixes: 8c0693e29dba ("Bluetooth: btintel_pcie: Support Product level reset")
Signed-off-by: Chandrashekar Devegowda <chandrashekar.devegowda@intel.com>
---
 drivers/bluetooth/btintel_pcie.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/bluetooth/btintel_pcie.c b/drivers/bluetooth/btintel_pcie.c
index eba563b66090..eeaefffaaf6b 100644
--- a/drivers/bluetooth/btintel_pcie.c
+++ b/drivers/bluetooth/btintel_pcie.c
@@ -2694,6 +2694,10 @@ static void btintel_pcie_remove(struct pci_dev *pdev)
 	struct btintel_pcie_data *data;
 
 	data = pci_get_drvdata(pdev);
+	if (!data) {
+		BT_WARN("PCI driver data is NULL, aborting remove");
+		return;
+	}
 
 	/* Cancel pending reset work. Skip only when remove() is called from
 	 * within the reset work itself (PLDR device_reprobe path) to avoid
-- 
2.43.0


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

end of thread, other threads:[~2026-06-01 19:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-01 10:26 [PATCH v1] Bluetooth: btintel_pcie: Fix null pointer dereference in remove Chandrashekar Devegowda
2026-06-01 12:47 ` [v1] " bluez.test.bot
2026-06-01 19:10 ` [PATCH v1] " patchwork-bot+bluetooth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox