drm/amdgpu: Free ras cmd input buffer properly
Subsystems (2)
PATCH 1/1 drm/amdgpu: Free ras cmd input buffer properly
Do not access the pointer for ras input cmd buffer if it is even not allocated.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +3 -3
@@ -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; }
Signature · 1 line
2.17.1
[AMD Official Use Only - General]
Regards,
Stanley
Quoted 41 lines
-----Original Message-----
From: Zhang, Hawking <[email protected]>
Sent: Tuesday, August 29, 2023 10:55 PM
To: [email protected]; Zhou1, Tao <[email protected]>; Yang, Stanley <[email protected]>
Cc: Zhang, Hawking <[email protected]>
Subject: [PATCH] drm/amdgpu: Free ras cmd input buffer properlyDo not access the pointer for ras input cmd buffer if it is even not allocated.
Signed-off-by Hawking Zhang <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +3
-3@@ -804,13 +804,13 @@ int amdgpu_ras_feature_enable(structamdgpu_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
Zhang, Hawking
Reviewed-by Stanley.Yang[AMD Official Use Only - General]
Sorry about that, will send it out a clean up version.
Regards,
Hawking
-----Original Message-----
From: Yang, Stanley <[email protected]>
Sent: Tuesday, August 29, 2023 23:00
To: Zhang, Hawking <[email protected]>; [email protected]; Zhou1, Tao <[email protected]>
Subject: RE: [PATCH] drm/amdgpu: Free ras cmd input buffer properly
[AMD Official Use Only - General]
Regards,
Stanley
Quoted 41 lines
-----Original Message-----
From: Zhang, Hawking <[email protected]>
Sent: Tuesday, August 29, 2023 10:55 PM
To: [email protected]; Zhou1, Tao <[email protected]>; Yang, Stanley <[email protected]>
Cc: Zhang, Hawking <[email protected]>
Subject: [PATCH] drm/amdgpu: Free ras cmd input buffer properlyDo not access the pointer for ras input cmd buffer if it is even not allocated.
Signed-off-by Hawking Zhang <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +3
-3@@ -804,13 +804,13 @@ int amdgpu_ras_feature_enable(structamdgpu_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