]> git.baikalelectronics.ru Git - kernel.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)
committerZhang Rui <rui.zhang@intel.com>
Tue, 24 Apr 2018 12:50:43 +0000 (20:50 +0800)
commit3c6d15897f0cea0fe6b2df8d42b2dc12761daa2a
treefa4cdc2804d153885ed95c6fa016bcd0cbe2a8db
parent5d30052dd442074c10ab35b64bd53a3dc43cea79
thermal: int3403_thermal: Fix NULL pointer deref on module load / probe

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>
drivers/thermal/int340x_thermal/int3403_thermal.c