linux/drivers/thermal/intel
Lee, Chun-Yi 39d5137085 thermal/int340x_thermal: handle data_vault when the value is ZERO_SIZE_PTR
commit 7931e28098 upstream.

In some case, the GDDV returns a package with a buffer which has
zero length. It causes that kmemdup() returns ZERO_SIZE_PTR (0x10).

Then the data_vault_read() got NULL point dereference problem when
accessing the 0x10 value in data_vault.

[   71.024560] BUG: kernel NULL pointer dereference, address:
0000000000000010

This patch uses ZERO_OR_NULL_PTR() for checking ZERO_SIZE_PTR or
NULL value in data_vault.

Signed-off-by: "Lee, Chun-Yi" <jlee@suse.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[ Larry: backport to 5.15.y. Minor conflict resolved due to missing commit 9e5d3d6be6
  thermal: int340x: Consolidate freeing of acpi_buffer pointer ]
Signed-off-by: Larry Bassel <larry.bassel@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2025-07-17 18:30:48 +02:00
..
int340x_thermal thermal/int340x_thermal: handle data_vault when the value is ZERO_SIZE_PTR 2025-07-17 18:30:48 +02:00
intel_bxt_pmic_thermal.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174 2019-05-30 11:26:41 -07:00
intel_menlow.c thermal/drivers/intel: Move intel_menlow to thermal drivers 2021-08-17 14:11:48 +02:00
intel_pch_thermal.c thermal: intel: intel_pch: Add support for Wellsburg PCH 2023-03-10 09:39:49 +01:00
intel_powerclamp.c thermal: intel: powerclamp: Fix cur_state for multi package system 2023-03-10 09:40:06 +01:00
intel_quark_dts_thermal.c thermal: intel: quark_dts: fix error pointer dereference 2023-03-11 13:57:32 +01:00
intel_soc_dts_iosf.c thermal: intel: Fix unsigned comparison with less than zero 2023-03-10 09:39:47 +01:00
intel_soc_dts_iosf.h thermal: intel: intel_soc_dts_iosf: Utilize for_each_set_clump8 macro 2019-12-04 19:44:12 -08:00
intel_soc_dts_thermal.c thermal: Convert to new X86 CPU match macros 2020-03-24 21:33:53 +01:00
intel_tcc_cooling.c drivers/thermal/intel: Add TCC cooling support for AlderLake platform 2021-08-14 12:41:36 +02:00
Kconfig thermal: intel: BXT_PMIC: select REGMAP instead of depending on it 2023-03-11 13:57:32 +01:00
Makefile thermal/drivers/intel: Move intel_menlow to thermal drivers 2021-08-17 14:11:48 +02:00
therm_throt.c thermal/drivers/intel: Allow processing of HWP interrupt 2021-09-09 16:33:20 +02:00
thermal_interrupt.h thermal/drivers/intel: Allow processing of HWP interrupt 2021-09-09 16:33:20 +02:00
x86_pkg_temp_thermal.c thermal/drivers/intel: Initialize RW trip to THERMAL_TEMP_INVALID 2021-05-14 09:37:27 +02:00