Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Conversation

plbossart
Copy link
Member

…_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
Copy link
Collaborator

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

@plbossart plbossart force-pushed the fix/acpi_dev_get_first_match_dev_check branch from fd47a63 to c7b35fb Compare July 23, 2024 17:43
@plbossart
Copy link
Member Author

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

indeed, thanks for noticing @bardliao. Fixed now.

…tch_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>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
@plbossart plbossart force-pushed the fix/acpi_dev_get_first_match_dev_check branch from c7b35fb to cdd1206 Compare July 24, 2024 09:07
@plbossart
Copy link
Member Author

updated commit title, no code change.

@plbossart plbossart merged commit 96ffc59 into thesofproject:topic/sof-dev Jul 26, 2024
11 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants