From: Dmitry Osipenko Date: Wed, 14 Jun 2017 23:18:33 +0000 (+0300) Subject: gpu: host1x: Correct host1x_job_pin() error handling X-Git-Tag: v5.15~10870^2~18^2~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e5855aa3e681bc417165604212c061e1c4b7cbda;p=platform%2Fkernel%2Flinux-starfive.git gpu: host1x: Correct host1x_job_pin() error handling In case of relocations / waitchecks patching failure the jobs pins stay referenced till DRM file get closed, wasting memory. Add the missed unpinning. Signed-off-by: Dmitry Osipenko Reviewed-by: Erik Faye-Lund Reviewed-by: Mikko Perttunen Signed-off-by: Thierry Reding --- diff --git a/drivers/gpu/host1x/job.c b/drivers/gpu/host1x/job.c index d993382..14f3f95 100644 --- a/drivers/gpu/host1x/job.c +++ b/drivers/gpu/host1x/job.c @@ -592,22 +592,20 @@ int host1x_job_pin(struct host1x_job *job, struct device *dev) err = do_relocs(job, g->bo); if (err) - break; + goto out; err = do_waitchks(job, host, g->bo); if (err) - break; + goto out; } - if (IS_ENABLED(CONFIG_TEGRA_HOST1X_FIREWALL) && !err) { - err = copy_gathers(job, dev); - if (err) { - host1x_job_unpin(job); - return err; - } - } + if (!IS_ENABLED(CONFIG_TEGRA_HOST1X_FIREWALL)) + goto out; + err = copy_gathers(job, dev); out: + if (err) + host1x_job_unpin(job); wmb(); return err;