Thread (38 messages) flat view 38 messages, 10 authors, 5d ago
COOLING5d

[PATCH v1 11/17] ALSA: hda: aw88399: Switch to use acpi_bus_get_primary_device()

From: "Rafael J. Wysocki" <rafael@kernel.org>
Date: 2026-09-21 19:58:12
Also in: linux-acpi, linux-efi, linux-sound, lkml, platform-driver-x86
Subsystem: sound, the rest · Maintainers: Jaroslav Kysela, Takashi Iwai, Linus Torvalds

From: "Rafael J. Wysocki" <redacted>

Replace acpi_get_first_physical_node() that is slated for removal
with acpi_bus_get_primary_device() that takes a reference to the
device it is about to return.

This addresses a potential use-after-free that may occur if the
device returned by acpi_get_first_physical_node() is removed right
after dropping its ACPI companion's physical_node_lock in that
function.

Signed-off-by: Rafael J. Wysocki <redacted>
---
 sound/hda/codecs/side-codecs/aw88399_hda.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/sound/hda/codecs/side-codecs/aw88399_hda.c b/sound/hda/codecs/side-codecs/aw88399_hda.c
index 11cef4923024..439ad45557a4 100644
--- a/sound/hda/codecs/side-codecs/aw88399_hda.c
+++ b/sound/hda/codecs/side-codecs/aw88399_hda.c
@@ -209,8 +209,7 @@ static int aw88399_hda_acpi_probe(struct aw88399_hda *aw88399)
 		return -ENODEV;
 	}
 
-	struct device *physdev __free(put_device) =
-		get_device(acpi_get_first_physical_node(adev));
+	struct device *physdev __free(put_device) = acpi_bus_get_primary_device(adev);
 	acpi_dev_put(adev);
 	if (!physdev)
 		return -ENODEV;
-- 
2.51.0




Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help