Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2639f2bf authored by Wei Yongjun's avatar Wei Yongjun Committed by Thierry Reding
Browse files

drm/tegra: fix error return code in gr2d_submit()



Fix to return -ENOENT in the host1x_bo lookup error handling
case instead of 0, as done elsewhere in this function.

Signed-off-by: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: default avatarThierry Reding <thierry.reding@avionic-design.de>
parent b6f2056f
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -135,8 +135,10 @@ static int gr2d_submit(struct host1x_drm_context *context,
			goto fail;

		bo = host1x_bo_lookup(drm, file, cmdbuf.handle);
		if (!bo)
		if (!bo) {
			err = -ENOENT;
			goto fail;
		}

		host1x_job_add_gather(job, bo, cmdbuf.words, cmdbuf.offset);
		num_cmdbufs--;
@@ -158,9 +160,11 @@ static int gr2d_submit(struct host1x_drm_context *context,
		reloc->cmdbuf = cmdbuf;
		reloc->target = target;

		if (!reloc->target || !reloc->cmdbuf)
		if (!reloc->target || !reloc->cmdbuf) {
			err = -ENOENT;
			goto fail;
		}
	}

	err = copy_from_user(job->waitchk, waitchks,
			     sizeof(*waitchks) * num_waitchks);