drm/amd/pm: fix warning using uninitialized value of max_vid_step
authorjsg <jsg@openbsd.org>
Mon, 9 Sep 2024 08:35:23 +0000 (08:35 +0000)
committerjsg <jsg@openbsd.org>
Mon, 9 Sep 2024 08:35:23 +0000 (08:35 +0000)
From Jesse Zhang
59dd0d4b33269c5173c648cb2c62f9649618e766 in linux-6.6.y/6.6.50
17e3bea65cdc453695b2fe4ff26d25d17f5339e9 in mainline linux

sys/dev/pci/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c

index 19a468e..c3eecc2 100644 (file)
@@ -2571,8 +2571,11 @@ static int vega10_init_smc_table(struct pp_hwmgr *hwmgr)
                }
        }
 
-       pp_atomfwctrl_get_voltage_table_v4(hwmgr, VOLTAGE_TYPE_VDDC,
+       result = pp_atomfwctrl_get_voltage_table_v4(hwmgr, VOLTAGE_TYPE_VDDC,
                        VOLTAGE_OBJ_SVID2,  &voltage_table);
+       PP_ASSERT_WITH_CODE(!result,
+                       "Failed to get voltage table!",
+                       return result);
        pp_table->MaxVidStep = voltage_table.max_vid_step;
 
        pp_table->GfxDpmVoltageMode =