[PATCH v2 3/5] ALSA: hda: cs35l41: Switch to use acpi_bus_get_primary_device()
Rafael J. Wysocki
rafael at kernel.org
Wed Sep 30 11:42:15 PDT 2026
From: "Rafael J. Wysocki" <rafael.j.wysocki at intel.com>
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 <rafael.j.wysocki at intel.com>
---
This patch depends on new material in linux-next.
If you maintain the code updated by it, please consider ACKing it, so I can
pick it up and remove the problematic API replaced by it during the 7.4
merge window.
In the absence of feedback, it will be resent again when 7.4-rc1 is out.
Thanks!
v1 -> v2: No changes
---
sound/hda/codecs/side-codecs/cs35l41_hda.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/sound/hda/codecs/side-codecs/cs35l41_hda.c b/sound/hda/codecs/side-codecs/cs35l41_hda.c
index 62296be45c55..32abb71dd401 100644
--- a/sound/hda/codecs/side-codecs/cs35l41_hda.c
+++ b/sound/hda/codecs/side-codecs/cs35l41_hda.c
@@ -1926,8 +1926,7 @@ static int cs35l41_hda_read_acpi(struct cs35l41_hda *cs35l41, const char *hid, i
}
cs35l41->dacpi = adev;
- 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);
if (!physdev) {
acpi_dev_put(adev);
return -ENODEV;
--
2.51.0
More information about the linux-arm-kernel
mailing list