]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
thermal: int3403_thermal: Fix NULL pointer deref on module load / probe
authorHans de Goede <hdegoede@redhat.com>
Sun, 22 Apr 2018 17:56:17 +0000 (19:56 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Jun 2018 19:01:24 +0000 (04:01 +0900)
commitab68702463690e6a1e9290bb30b7cba93e6b0dca
tree7ee161095c07afaacc6e156dce6786ed02addc3c
parent42b0029bada451f2fcbf5245fe2bf720f85c8b59
thermal: int3403_thermal: Fix NULL pointer deref on module load / probe

[ Upstream commit 13b86f50eaaddaea4bdd2fe476fd12e6a0951add ]

Starting with kernel 4.17 thermal_cooling_device_register() will call the
get_max_state() op during register.

Since we deref priv->priv in int3403_get_max_state() this means we must
set priv->priv before calling thermal_cooling_device_register().

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/thermal/int340x_thermal/int3403_thermal.c