aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/x86/utils.c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2024-11-09 23:00:28 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2024-11-12 21:21:58 +0100
commit4a49194f587a62d972b602e3e1a2c3cfe6567966 (patch)
tree85b0ad885a0b67d328fec07b5364efc36a22d6fa /drivers/acpi/x86/utils.c
parentACPI: x86: Make UART skip quirks work on PCI UARTs without an UID (diff)
downloadlinux-rng-4a49194f587a62d972b602e3e1a2c3cfe6567966.tar.xz
linux-rng-4a49194f587a62d972b602e3e1a2c3cfe6567966.zip
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>
Diffstat (limited to 'drivers/acpi/x86/utils.c')
-rw-r--r--drivers/acpi/x86/utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/acpi/x86/utils.c b/drivers/acpi/x86/utils.c
index 3eec889d4f5f..423565c31d5e 100644
--- a/drivers/acpi/x86/utils.c
+++ b/drivers/acpi/x86/utils.c
@@ -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.