[PATCH] drm/amdgpu: Fix null pointer amdgpu_device_fw_loading

Huang Rui ray.huang at amd.com
Thu Oct 18 06:59:02 UTC 2018


On Thu, Oct 18, 2018 at 02:27:18PM +0800, Emily Deng wrote:
> Need to check adev->powerplay.pp_funcs.
> 
> Signed-off-by: Emily Deng <Emily.Deng at amd.com>

Reviewed-by: Huang Rui <ray.huang at amd.com>

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index 618d9e5..e26dfc9 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -1651,7 +1651,7 @@ static int amdgpu_device_fw_loading(struct amdgpu_device *adev)
>  		}
>  	}
>  
> -	if (adev->powerplay.pp_funcs->load_firmware) {
> +	if (adev->powerplay.pp_funcs && adev->powerplay.pp_funcs->load_firmware) {
>  		r = adev->powerplay.pp_funcs->load_firmware(adev->powerplay.pp_handle);
>  		if (r) {
>  			pr_err("firmware loading failed\n");
> -- 
> 2.7.4
> 
> _______________________________________________
> 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