thermal: core: Fix TZ_GET_TRIP NULL pointer dereference
authorNicolas Cavallari <nicolas.cavallari@green-communications.fr>
Mon, 28 Feb 2022 11:03:51 +0000 (12:03 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 8 Mar 2022 18:09:32 +0000 (19:09 +0100)
commit1c0b51e62a50e9291764d022ed44549e65d6ab9c
treee1bfe73ea357bf29e889afc0beb81db1f0911000
parenta1753d5c29a6fb9a8966dcf04cb4f3b71e303ae8
thermal: core: Fix TZ_GET_TRIP NULL pointer dereference

commit 5838a14832d447990827d85e90afe17e6fb9c175 upstream.

Do not call get_trip_hyst() from thermal_genl_cmd_tz_get_trip() if
the thermal zone does not define one.

Fixes: 1ce50e7d408e ("thermal: core: genetlink support for events/cmd/sampling")
Signed-off-by: Nicolas Cavallari <nicolas.cavallari@green-communications.fr>
Cc: 5.10+ <stable@vger.kernel.org> # 5.10+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/thermal/thermal_netlink.c