[PATCH] drm/amdgpu: Free ras cmd input buffer properly
Zhang, Hawking
Hawking.Zhang at amd.com
Tue Aug 29 15:25:58 UTC 2023
[AMD Official Use Only - General]
Sorry about that, will send it out a clean up version.
Regards,
Hawking
-----Original Message-----
From: Yang, Stanley <Stanley.Yang at amd.com>
Sent: Tuesday, August 29, 2023 23:00
To: Zhang, Hawking <Hawking.Zhang at amd.com>; amd-gfx at lists.freedesktop.org; Zhou1, Tao <Tao.Zhou1 at amd.com>
Subject: RE: [PATCH] drm/amdgpu: Free ras cmd input buffer properly
[AMD Official Use Only - General]
Reviewed-by: Stanley.Yang <Stanley.Yang at amd.com>
Regards,
Stanley
> -----Original Message-----
> From: Zhang, Hawking <Hawking.Zhang at amd.com>
> Sent: Tuesday, August 29, 2023 10:55 PM
> To: amd-gfx at lists.freedesktop.org; Zhou1, Tao <Tao.Zhou1 at amd.com>;
> Yang, Stanley <Stanley.Yang at amd.com>
> Cc: Zhang, Hawking <Hawking.Zhang at amd.com>
> Subject: [PATCH] drm/amdgpu: Free ras cmd input buffer properly
>
> Do not access the pointer for ras input cmd buffer if it is even not allocated.
>
> Signed-off-by: Hawking Zhang <Hawking.Zhang at amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> index e47600a8e88e..16c5fe487ea0 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> @@ -804,13 +804,13 @@ int amdgpu_ras_feature_enable(struct
> amdgpu_device *adev,
>
> amdgpu_ras_is_poison_mode_supported(adev), ret);
> goto out;
> }
> +
> + kfree(info);
> }
>
> /* setup the obj */
> __amdgpu_ras_feature_enable(adev, head, enable);
> -out:
> - if (head->block == AMDGPU_RAS_BLOCK__GFX)
> - kfree(info);
> +
> return ret;
> }
>
> --
> 2.17.1
More information about the amd-gfx
mailing list