[AMD Official Use Only - General] Reviewed-by: Stanley.Yang <Stanley.Yang@xxxxxxx> Regards, Stanley > -----Original Message----- > From: Zhang, Hawking <Hawking.Zhang@xxxxxxx> > Sent: Tuesday, August 29, 2023 10:55 PM > To: amd-gfx@xxxxxxxxxxxxxxxxxxxxx; Zhou1, Tao <Tao.Zhou1@xxxxxxx>; > Yang, Stanley <Stanley.Yang@xxxxxxx> > Cc: Zhang, Hawking <Hawking.Zhang@xxxxxxx> > 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@xxxxxxx> > --- > 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