[PATCH] drm/amdgpu: properly initialize return value during CS

Christian König ckoenig.leichtzumerken at gmail.com
Tue Sep 20 12:15:59 UTC 2022


The return value is no longer initialized before the loop because of
moving code around.

Signed-off-by: Christian König <christian.koenig at amd.com>
Fixes: 1ce5d2d0c831 ("drm/amdgpu: move entity selection and job init earlier during CS")
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
index 58088c663125..e452350f462a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@ -1184,6 +1184,7 @@ static int amdgpu_cs_submit(struct amdgpu_cs_parser *p,
 	/* If userptr are invalidated after amdgpu_cs_parser_bos(), return
 	 * -EAGAIN, drmIoctl in libdrm will restart the amdgpu_cs_ioctl.
 	 */
+	r = 0;
 	amdgpu_bo_list_for_each_userptr_entry(e, p->bo_list) {
 		struct amdgpu_bo *bo = ttm_to_amdgpu_bo(e->tv.bo);
 
-- 
2.25.1



More information about the amd-gfx mailing list