-
Notifications
You must be signed in to change notification settings - Fork 133
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: sdca: test adev before calling acpi_dev_for_each_child #5238
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bardliao, nice catch!
sound/soc/sdca/sdca_functions.c
Outdated
@@ -165,6 +165,10 @@ void sdca_lookup_functions(struct sdw_slave *slave) | |||
struct device *dev = &slave->dev; | |||
struct acpi_device *adev = to_acpi_device_node(dev->fwnode); | |||
|
|||
if (!adev) { | |||
dev_dbg(dev, "Not an ACPI device\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would move this to info level to be visible and rephrase the print to something like 'No matching ACPI device found, ignoring peripheral`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw, do you need/want Fixes tag?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw, do you need/want Fixes tag?
Yes, done.
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: 3a513da ("ASoC: SDCA: add initial module") Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
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.