drm/amd/powerplay: fix static checker warnings in smu7_hwmgr.c
authorRex Zhu <Rex.Zhu@amd.com>
Thu, 13 Oct 2016 07:32:04 +0000 (15:32 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 13 Oct 2016 23:14:17 +0000 (19:14 -0400)
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c

index 7c67a5a9118238b02c96f941f543a55f56cb78f4..e7fb8e95436b1c2abb82bc256b2579a6b33b6c02 100644 (file)
@@ -1452,8 +1452,10 @@ static int smu7_get_evv_voltages(struct pp_hwmgr *hwmgr)
        struct phm_ppt_v1_clock_voltage_dependency_table *sclk_table = NULL;
 
 
-       if (table_info != NULL)
-               sclk_table = table_info->vdd_dep_on_sclk;
+       if (table_info == NULL)
+               return -EINVAL;
+
+       sclk_table = table_info->vdd_dep_on_sclk;
 
        for (i = 0; i < SMU7_MAX_LEAKAGE_COUNT; i++) {
                vv_id = ATOM_VIRTUAL_VOLTAGE_ID0 + i;