Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: sdca: test adev before calling acpi_dev_for_each_child

sdca_lookup_functions may be called by a Peripheral that is not listed
in the ACPI table. Testing adev is required to avoid kernel NULL pointer
dereference.

Fixes: 3a513da1ae33 ("ASoC: SDCA: add initial module")
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://patch.msgid.link/20241113064133.162501-1-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Bard Liao and committed by
Mark Brown
de35b06b fb5e67c9

+4
+4
sound/soc/sdca/sdca_functions.c
··· 165 165 struct device *dev = &slave->dev; 166 166 struct acpi_device *adev = to_acpi_device_node(dev->fwnode); 167 167 168 + if (!adev) { 169 + dev_info(dev, "No matching ACPI device found, ignoring peripheral\n"); 170 + return; 171 + } 168 172 acpi_dev_for_each_child(adev, find_sdca_function, &slave->sdca_data); 169 173 } 170 174 EXPORT_SYMBOL_NS(sdca_lookup_functions, SND_SOC_SDCA);