]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
platform/x86: int3472: Check for adev == NULL
authorHans de Goede <hdegoede@redhat.com>
Mon, 9 Dec 2024 22:05:19 +0000 (23:05 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Feb 2025 12:49:33 +0000 (13:49 +0100)
commit4f8b210823cc2d1f9d967f089a6c00d025bb237f
tree111f098acb3a7a4de706b7ab208b5a1127c1ecc2
parentb3847b6622a329938a802335bb3caeafd1807d7f
platform/x86: int3472: Check for adev == NULL

[ Upstream commit cd2fd6eab480dfc247b737cf7a3d6b009c4d0f1c ]

Not all devices have an ACPI companion fwnode, so adev might be NULL. This
can e.g. (theoretically) happen when a user manually binds one of
the int3472 drivers to another i2c/platform device through sysfs.

Add a check for adev not being set and return -ENODEV in that case to
avoid a possible NULL pointer deref in skl_int3472_get_acpi_buffer().

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20241209220522.25288-1-hdegoede@redhat.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/platform/x86/intel/int3472/discrete.c
drivers/platform/x86/intel/int3472/tps68470.c