OSDN Git Service

drm/amdgpu: Fix memory leak in amdgpu_cs_pass1
authorDong Chenchen <dongchenchen2@huawei.com>
Thu, 10 Nov 2022 14:33:14 +0000 (22:33 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 10 Nov 2022 20:30:34 +0000 (15:30 -0500)
commit2ebf61f2cfb9a11bc17db30df3e675a4cd7418d3
treeb69907b675ff94bd38fa8478db2187e931ffdeee
parentfe6d2ca6f3f806f2f03e961d80cdbf27073868c8
drm/amdgpu: Fix memory leak in amdgpu_cs_pass1

When p->gang_size equals 0, amdgpu_cs_pass1() will return directly
without freeing chunk_array, which will cause a memory leak issue,
this patch fixes it.

Fixes: 4624459c84d7 ("drm/amdgpu: add gang submit frontend v6")
Reviewed-by: Luben Tuikov <luben.tuikov@amd.com>
Signed-off-by: Dong Chenchen <dongchenchen2@huawei.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c