Skip to content

Commit a4ffdb6

Browse files
committed
Merge tag 'thermal-5.17-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull thermal control fix from Rafael Wysocki: "Fix NULL pointer dereference in the thermal netlink interface (Nicolas Cavallari)" * tag 'thermal-5.17-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: thermal: core: Fix TZ_GET_TRIP NULL pointer dereference
2 parents 8d67094 + 5838a14 commit a4ffdb6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/thermal/thermal_netlink.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,11 +419,12 @@ static int thermal_genl_cmd_tz_get_trip(struct param *p)
419419
for (i = 0; i < tz->trips; i++) {
420420

421421
enum thermal_trip_type type;
422-
int temp, hyst;
422+
int temp, hyst = 0;
423423

424424
tz->ops->get_trip_type(tz, i, &type);
425425
tz->ops->get_trip_temp(tz, i, &temp);
426-
tz->ops->get_trip_hyst(tz, i, &hyst);
426+
if (tz->ops->get_trip_hyst)
427+
tz->ops->get_trip_hyst(tz, i, &hyst);
427428

428429
if (nla_put_u32(msg, THERMAL_GENL_ATTR_TZ_TRIP_ID, i) ||
429430
nla_put_u32(msg, THERMAL_GENL_ATTR_TZ_TRIP_TYPE, type) ||

0 commit comments

Comments
 (0)