]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
sonypi: Check ACPI_COMPANION() against NULL at probe time
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 12 May 2026 16:20:53 +0000 (18:20 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 May 2026 11:47:34 +0000 (13:47 +0200)
commit950f35211b85db26fc1aae67bf1e14ccef393a0a
tree413184262d04e1b635dfef4ad64936a9d0b03627
parentfa5e2952341b792b72d5410dbfcd0b2ac8046d2a
sonypi: Check ACPI_COMPANION() against NULL at probe time

Every platform driver can be forced to match a device that doesn't match
its list of device IDs because of device_match_driver_override(), so
platform drivers that rely on the existence of a device's ACPI companion
object need to verify its presence.

Accordingly, add a requisite ACPI_COMPANION() check against NULL to the
sonypi driver.

Fixes: 7e488b0af021 ("sonypi: Convert ACPI driver to a platform one")
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/5087721.GXAFRqVoOG@rafael.j.wysocki
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/sonypi.c