Skip to content

Commit 4a49194

Browse files
jwrdegoederafaeljw
authored andcommitted
ACPI: x86: Add adev NULL check to acpi_quirk_skip_serdev_enumeration()
acpi_dev_hid_match() does not check for adev == NULL, dereferencing it unconditional. Add a check for adev being NULL before calling acpi_dev_hid_match(). At the moment acpi_quirk_skip_serdev_enumeration() is never called with a controller_parent without an ACPI companion, but better safe than sorry. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://patch.msgid.link/20241109220028.83047-1-hdegoede@redhat.com Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 7f26120 commit 4a49194

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/acpi/x86/utils.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ int acpi_quirk_skip_serdev_enumeration(struct device *controller_parent, bool *s
536536
* Set skip to true so that the tty core creates a serdev ctrl device.
537537
* The backlight driver will manually create the serdev client device.
538538
*/
539-
if (acpi_dev_hid_match(adev, "DELL0501")) {
539+
if (adev && acpi_dev_hid_match(adev, "DELL0501")) {
540540
*skip = true;
541541
/*
542542
* Create a platform dev for dell-uart-backlight to bind to.

0 commit comments

Comments
 (0)