Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

thermal/drivers/hisi: Drop second sensor hi3660

The commit 74c8e6bffbe1 ("driver core: Add __alloc_size hint to devm
allocators") exposes a panic "BRK handler: Fatal exception" on the
hi3660_thermal_probe funciton.
This is because the function allocates memory for only one
sensors array entry, but tries to fill up a second one.

Fix this by removing the unneeded second access.

Fixes: 7d3a2a2bbadb ("thermal/drivers/hisi: Fix number of sensors on hi3660")
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
Link: https://lore.kernel.org/linux-mm/20221101223321.1326815-5-keescook@chromium.org/
Link: https://lore.kernel.org/r/20230210141507.71014-1-yongqin.liu@linaro.org
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Yongqin Liu and committed by
Rafael J. Wysocki
15cc2582 47b2d3d2

-4
-4
drivers/thermal/hisi_thermal.c
··· 427 427 data->sensor[0].irq_name = "tsensor_a73"; 428 428 data->sensor[0].data = data; 429 429 430 - data->sensor[1].id = HI3660_LITTLE_SENSOR; 431 - data->sensor[1].irq_name = "tsensor_a53"; 432 - data->sensor[1].data = data; 433 - 434 430 return 0; 435 431 } 436 432