VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   32 Branches   54 Tags
author: Dmitry Osipenko <digetx@gmail.com> 2018-07-06 21:02:36 +0300 committer: Thierry Reding <treding@nvidia.com> 2018-07-09 10:31:30 +0200 commit: ec58923215dbbeef59ee82923ee94d745f73db58 parent: 4466b1f0e022f94a026bd700fee34bff15cdc4ef
Commit Summary:
gpu: host1x: Check whether size of unpin isn't 0
Diffstat:
1 file changed, 2 insertions, 1 deletion
diff --git a/drivers/gpu/host1x/job.c b/drivers/gpu/host1x/job.c
index e2f4a4d93d20..527a1cddb14f 100644
--- a/drivers/gpu/host1x/job.c
+++ b/drivers/gpu/host1x/job.c
@@ -569,7 +569,8 @@ void host1x_job_unpin(struct host1x_job *job)
 	for (i = 0; i < job->num_unpins; i++) {
 		struct host1x_job_unpin_data *unpin = &job->unpins[i];
 
-		if (!IS_ENABLED(CONFIG_TEGRA_HOST1X_FIREWALL) && host->domain) {
+		if (!IS_ENABLED(CONFIG_TEGRA_HOST1X_FIREWALL) &&
+		    unpin->size && host->domain) {
 			iommu_unmap(host->domain, job->addr_phys[i],
 				    unpin->size);
 			free_iova(&host->iova,