Skip to contentSkip to conversation

fix: crypto/tegra: tegra_se_host1x_submit: timeout path leaks host1x_job reference

PATCH New WenTao Liang 2 participants 2 messages Jun 26

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix: crypto/tegra: tegra_se_host1x_submit: timeout path leaks host1x_job reference

When host1x_syncpt_wait returns a timeout error, the function returns ret
directly without calling host1x_job_put(job). The job reference acquired by host1x_job_alloc is properly released on all other error paths via the job_put label but is missing on the timeout path.

Fixes 0880bb3b00c8 ("crypto: tegra - Add Tegra Security Engine driver")
---
 drivers/crypto/tegra/tegra-se-main.c | 1 +
 1 file changed, 1 insertion(+)
drivers/crypto/tegra/tegra-se-main.c +1 -0
index eb71113ed146..7fbf69236ff2 100644
@@ -180,6 +180,7 @@ int tegra_se_host1x_submit(struct tegra_se *se, struct tegra_se_cmdbuf *cmdbuf,
 				 MAX_SCHEDULE_TIMEOUT, NULL);
 	if (ret) {
 		dev_err(se->dev, "host1x job timed out\n");
+		host1x_job_put(job);
 		return ret;
 	}
 
Signature · 1 line
2.39.5 (Apple Git-154)
maintainer
#1 lore raw

PATCH 1/1 fix: crypto/tegra: tegra_se_host1x_submit: timeout path leaks host1x_job reference

Quoted 8 lines · WenTao Liang

When host1x_syncpt_wait returns a timeout error, the function returns ret
directly without calling host1x_job_put(job). The job reference acquired by host1x_job_alloc is properly released on all other error paths via the job_put label but is missing on the timeout path.

Fixes 0880bb3b00c8 ("crypto: tegra - Add Tegra Security Engine driver")

This fix is already applied in linux-next as commit 6ea0ce3a19f9 ("crypto: tegra - fix refcount leak in tegra_se_host1x_submit()").

https://lore.kernel.org/linux-tegra/[email protected]/T/#t

Regards,
Akhil