[PATCH] drm/amd/powerplay: fix a warning in pp_hw_init

Alex Deucher alexdeucher at gmail.com
Sun Oct 1 21:23:10 UTC 2017


On Fri, Sep 29, 2017 at 10:41 PM, Zhu, Rex <Rex.Zhu at amd.com> wrote:
> Hi Alex,
>
> Thanks for pointing out the logic error in pp_hw_init.
> Please review the attached patch.

Acked-by: Alex Deucher <alexander.deucher at amd.com>

>
> Best Regards
> Rex
>
>
>
> -----Original Message-----
> From: amd-gfx [mailto:amd-gfx-bounces at lists.freedesktop.org] On Behalf Of Alex Deucher
> Sent: Saturday, September 30, 2017 12:38 AM
> To: amd-gfx at lists.freedesktop.org
> Cc: Deucher, Alexander
> Subject: [PATCH] drm/amd/powerplay: fix a warning in pp_hw_init
>
> Make sure hwmgr is valid.
>
> Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
> ---
>  drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
> index 44b0616..e96ab0b 100644
> --- a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
> +++ b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
> @@ -146,7 +146,7 @@ static int pp_hw_init(void *handle)  {
>         int ret = 0;
>         struct pp_instance *pp_handle = (struct pp_instance *)handle;
> -       struct pp_hwmgr *hwmgr;
> +       struct pp_hwmgr *hwmgr = NULL;
>
>         ret = pp_check(pp_handle);
>
> @@ -171,7 +171,8 @@ static int pp_hw_init(void *handle)
>         return 0;
>  exit:
>         pp_handle->pm_en = 0;
> -       cgs_notify_dpm_enabled(hwmgr->device, false);
> +       if (hwmgr)
> +               cgs_notify_dpm_enabled(hwmgr->device, false);
>         return 0;
>
>  }
> --
> 2.5.5
>
> _______________________________________________
> 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