aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Osipenko <digetx@gmail.com>2018-07-06 14:02:36 -0400
committerThierry Reding <treding@nvidia.com>2018-07-09 04:31:30 -0400
commitec58923215dbbeef59ee82923ee94d745f73db58 (patch)
tree40f8358325acc7055a5b55ff94c87899ea609792
parent4466b1f0e022f94a026bd700fee34bff15cdc4ef (diff)
gpu: host1x: Check whether size of unpin isn't 0
Only gather pins are mapped by the Host1x driver, regular BO relocations are not. Check whether size of unpin isn't 0, otherwise IOVA allocation at 0x0 could be erroneously released. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
-rw-r--r--drivers/gpu/host1x/job.c3
1 files changed, 2 insertions, 1 deletions
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)
569 for (i = 0; i < job->num_unpins; i++) { 569 for (i = 0; i < job->num_unpins; i++) {
570 struct host1x_job_unpin_data *unpin = &job->unpins[i]; 570 struct host1x_job_unpin_data *unpin = &job->unpins[i];
571 571
572 if (!IS_ENABLED(CONFIG_TEGRA_HOST1X_FIREWALL) && host->domain) { 572 if (!IS_ENABLED(CONFIG_TEGRA_HOST1X_FIREWALL) &&
573 unpin->size && host->domain) {
573 iommu_unmap(host->domain, job->addr_phys[i], 574 iommu_unmap(host->domain, job->addr_phys[i],
574 unpin->size); 575 unpin->size);
575 free_iova(&host->iova, 576 free_iova(&host->iova,