Re: [PATCH v1] drivers:amdgpu: check the return value of amdgpu_bo_kmap

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Sep 21, 2022 at 7:11 PM Chen, Guchun <Guchun.Chen@xxxxxxx> wrote:
>
> Perhaps you need to update the prefix of patch subject to 'drm/amd/pm: check return value ...'.
>
> With above addressed, it's: Acked-by: Guchun Chen <guchun.chen@xxxxxxx>
>
> Regards,
> Guchun
>
> -----Original Message-----
> From: Li Zhong <floridsleeves@xxxxxxxxx>
> Sent: Thursday, September 22, 2022 9:27 AM
> To: dri-devel@xxxxxxxxxxxxxxxxxxxxx; amd-gfx@xxxxxxxxxxxxxxxxxxxxx
> Cc: jiapeng.chong@xxxxxxxxxxxxxxxxx; Powell, Darren <Darren.Powell@xxxxxxx>; Chen, Guchun <Guchun.Chen@xxxxxxx>; Limonciello, Mario <Mario.Limonciello@xxxxxxx>; Quan, Evan <Evan.Quan@xxxxxxx>; Lazar, Lijo <Lijo.Lazar@xxxxxxx>; daniel@xxxxxxxx; airlied@xxxxxxxx; Pan, Xinhui <Xinhui.Pan@xxxxxxx>; Koenig, Christian <Christian.Koenig@xxxxxxx>; Deucher, Alexander <Alexander.Deucher@xxxxxxx>; Li Zhong <floridsleeves@xxxxxxxxx>
> Subject: [PATCH v1] drivers:amdgpu: check the return value of amdgpu_bo_kmap
>
> amdgpu_bo_kmap() returns error when fails to map buffer object. Add the error check and propagate the error.
>
> Signed-off-by: Li Zhong <floridsleeves@xxxxxxxxx>
> ---
>  drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c b/drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c
> index 1eb4e613b27a..ec055858eb95 100644
> --- a/drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c
> +++ b/drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c
> @@ -1485,6 +1485,7 @@ static int pp_get_prv_buffer_details(void *handle, void **addr, size_t *size)  {
>         struct pp_hwmgr *hwmgr = handle;
>         struct amdgpu_device *adev = hwmgr->adev;
> +       int err;
>
>         if (!addr || !size)
>                 return -EINVAL;
> @@ -1492,7 +1493,9 @@ static int pp_get_prv_buffer_details(void *handle, void **addr, size_t *size)
>         *addr = NULL;
>         *size = 0;
>         if (adev->pm.smu_prv_buffer) {
> -               amdgpu_bo_kmap(adev->pm.smu_prv_buffer, addr);
> +               err = amdgpu_bo_kmap(adev->pm.smu_prv_buffer, addr);
> +               if (err)
> +                       return err;
>                 *size = adev->pm.smu_prv_buffer_size;
>         }
>
> --
> 2.25.1
>

Thanks for your reply! It's updated in the v2 patch.




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux