summaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorRex Zhu <Rex.Zhu@amd.com>2016-05-10 13:39:29 +0800
committerAlex Deucher <alexander.deucher@amd.com>2016-05-13 14:26:11 -0400
commit2dcbffad94f3c2f85cc2c433dad382a741e91dc4 (patch)
tree9b5209780f7a2afba3dc4abbf888ccb82a9b766a /drivers/gpu
parent9ab9cf058a5de590146fdc67bf9c483c8bdcbffa (diff)
downloadop-kernel-dev-2dcbffad94f3c2f85cc2c433dad382a741e91dc4.zip
op-kernel-dev-2dcbffad94f3c2f85cc2c433dad382a741e91dc4.tar.gz
drm/amd/powerplay: fix NULL point check error
&& was used instead of || Signed-off-by: Rex Zhu <Rex.Zhu@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.c
index 94b2a73..4115dd8 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.c
@@ -199,8 +199,9 @@ void phm_apply_dal_min_voltage_request(struct pp_hwmgr *hwmgr)
enum PP_DAL_POWERLEVEL dal_power_level = hwmgr->dal_power_level;
uint32_t req_vddc = 0, req_volt, i;
- if (!table && !(dal_power_level >= PP_DAL_POWERLEVEL_ULTRALOW &&
- dal_power_level <= PP_DAL_POWERLEVEL_PERFORMANCE))
+ if (!table || table-count <= 0
+ || dal_power_level < PP_DAL_POWERLEVEL_ULTRALOW
+ || dal_power_level > PP_DAL_POWERLEVEL_PERFORMANCE)
return;
for (i = 0; i < table->count; i++) {
OpenPOWER on IntegriCloud