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>
        if (hwmgr->thermal_controller.fanInfo.bNoFan ||
                        (hwmgr->thermal_controller.fanInfo.
                        ucTachometerPulsesPerRevolution == 0) ||
+                       speed == 0 ||
                        (speed < hwmgr->thermal_controller.fanInfo.ulMinRPM) ||
                        (speed > hwmgr->thermal_controller.fanInfo.ulMaxRPM))
                return 0;
 
        int result = 0;
 
        if (hwmgr->thermal_controller.fanInfo.bNoFan ||
+           speed == 0 ||
            (speed < hwmgr->thermal_controller.fanInfo.ulMinRPM) ||
            (speed > hwmgr->thermal_controller.fanInfo.ulMaxRPM))
                return -1;