Skip to content

Commit c0ec082

Browse files
donutAneesalexdeucher
authored andcommitted
drm/amdgpu: prevent BO_HANDLES error from being overwritten
Before this patch, if multiple BO_HANDLES chunks were submitted, the error -EINVAL would be correctly set but could be overwritten by the return value from amdgpu_cs_p1_bo_handles(). This patch ensures that if there are multiple BO_HANDLES, we stop. Fixes: fec5f8e ("drm/amdgpu: disallow multiple BO_HANDLES chunks in one submit") Signed-off-by: Mohammed Anees <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Pierre-Eric Pelloux-Prayer <[email protected]> Signed-off-by: Alex Deucher <[email protected]> (cherry picked from commit 40f2cd9) Cc: [email protected]
1 parent d2c72d9 commit c0ec082

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ static int amdgpu_cs_pass1(struct amdgpu_cs_parser *p,
265265

266266
/* Only a single BO list is allowed to simplify handling. */
267267
if (p->bo_list)
268-
ret = -EINVAL;
268+
goto free_partial_kdata;
269269

270270
ret = amdgpu_cs_p1_bo_handles(p, p->chunks[i].kdata);
271271
if (ret)

0 commit comments

Comments
 (0)