[PATCH] drm/amdgpu: Check if smu.ppt_funcs is initialized before accessing

Li, Sun peng (Leo) Sunpeng.Li at amd.com
Mon Apr 22 13:27:11 UTC 2019


>>> -       if (adev->smu.ppt_funcs->get_current_power_state)
>>> +       if (adev->smu.ppt_funcs && adev->smu.ppt_funcs-
>>> get_current_power_state)
>>
>> For consistency, I think we probably want something like:
>> if (is_support_sw_smu(adev) && adev->smu.ppt_funcs-
>>> get_current_power_state)
>>
>> Either way:
>> Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
> 
> Yes. The same comment with me. Please use is_support_sw_smu() to check it.
> With that fixed, please add Reviewed-by: Huang Rui <ray.huang at amd.com>
> 

Will modify and merge.

Thanks,
Leo

>>
>>>                  pm = amdgpu_smu_get_current_power_state(adev);
>>>          else if (adev->powerplay.pp_funcs->get_current_power_state)
>>>                  pm = amdgpu_dpm_get_current_power_state(adev);
>>> --
>>> 2.7.4
>>>
>>> _______________________________________________
>>> amd-gfx mailing list
>>> amd-gfx at lists.freedesktop.org
>>> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
>> _______________________________________________
>> amd-gfx mailing list
>> amd-gfx at lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/amd-gfx


More information about the amd-gfx mailing list