thesofproject / linux

Linux kernel source tree
Other
91 stars 134 forks source link

ASoC: SOF: Intel: always check the result of acpi_dev_get_first_match… #5117

Closed plbossart closed 4 months ago

plbossart commented 4 months ago

…_dev()

The code seems mostly copy-pasted, with some machine drivers forgetting to test if the 'adev' result is NULL.

Add this check when missing, and use -ENOENT consistently as an error code.

Link: https://lore.kernel.org/alsa-devel/918944d2-3d00-465e-a9d1-5d57fc966113@stanley.mountain/T/#u Reported-by: Dan Carpenter dan.carpenter@linaro.org

bardliao commented 4 months ago

sof_wm8804.c is missed. adev = acpi_dev_get_first_match_dev(mach->id, NULL, -1);

plbossart commented 4 months ago

sof_wm8804.c is missed. adev = acpi_dev_get_first_match_dev(mach->id, NULL, -1);

indeed, thanks for noticing @bardliao. Fixed now.

plbossart commented 4 months ago

updated commit title, no code change.