]> Git Repo - linux.git/commitdiff
ACPI: x86: Add adev NULL check to acpi_quirk_skip_serdev_enumeration()
authorHans de Goede <[email protected]>
Sat, 9 Nov 2024 22:00:28 +0000 (23:00 +0100)
committerRafael J. Wysocki <[email protected]>
Tue, 12 Nov 2024 20:21:58 +0000 (21:21 +0100)
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 <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Rafael J. Wysocki <[email protected]>
drivers/acpi/x86/utils.c

index 3eec889d4f5f838ebce1e1bdc8debc2e001a30a2..423565c31d5ef36453d5ad55c465a35546f64f0b 100644 (file)
@@ -536,7 +536,7 @@ int acpi_quirk_skip_serdev_enumeration(struct device *controller_parent, bool *s
         * Set skip to true so that the tty core creates a serdev ctrl device.
         * The backlight driver will manually create the serdev client device.
         */
-       if (acpi_dev_hid_match(adev, "DELL0501")) {
+       if (adev && acpi_dev_hid_match(adev, "DELL0501")) {
                *skip = true;
                /*
                 * Create a platform dev for dell-uart-backlight to bind to.
This page took 0.053666 seconds and 4 git commands to generate.