Skip to content

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.

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