drm/amdgpu: prevent memory leaks in AMDGPU_CS ioctl
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Tue, 20 Aug 2019 13:39:53 +0000 (15:39 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 22 Aug 2019 03:18:38 +0000 (22:18 -0500)
commit5a6a4c9d1b6743268480b5b5661a35c38d4df424
treef770f59187dca7ea7bcd3a14bea51347f3e27462
parent452575c5703cd7d0cf285ef7a97de52af9a3d70d
drm/amdgpu: prevent memory leaks in AMDGPU_CS ioctl

Error out if the AMDGPU_CS ioctl is called with multiple SYNCOBJ_OUT and/or
TIMELINE_SIGNAL chunks, since otherwise the last chunk wins while the
allocated array as well as the reference counts of sync objects are leaked.

Signed-off-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c