OSDN Git Service

drm/amd/pp: Avoid divide-by-zero in fan_ctrl_set_fan_speed_rpm
authorRex Zhu <Rex.Zhu@amd.com>
Thu, 20 Sep 2018 03:50:26 +0000 (11:50 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 9 Oct 2018 22:00:25 +0000 (17:00 -0500)
commitc52dcf49195d06319189c7f1dd8b62bfca545197
treeb4e6003fff6f0dfa55d57059e496d9d249839d0a
parentb3ca0f397ead2d794921ec3a08c132dadb37874e
drm/amd/pp: Avoid divide-by-zero in fan_ctrl_set_fan_speed_rpm

The minRPM speed maybe equal to zero. so need to check
input RPM not equal to 0, otherwise cause divide-by-zero driver crash.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_thermal.c
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c