drm/amdgpu: properly initialize return value during CS
authorChristian König <christian.koenig@amd.com>
Tue, 20 Sep 2022 12:13:33 +0000 (14:13 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 20 Sep 2022 16:41:08 +0000 (12:41 -0400)
The return value is no longer initialized before the loop because of
moving code around.

Signed-off-by: Christian König <christian.koenig@amd.com>
Fixes: c2b08e7a6d27 ("drm/amdgpu: move entity selection and job init earlier during CS")
Reviewed-by: Guchun Chen <guchun.chen@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c

index a26e769..1bbd39b 100644 (file)
@@ -1260,6 +1260,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);