]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drm/tegra: fix error return code in gr2d_submit()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Wed, 24 Apr 2013 06:50:51 +0000 (14:50 +0800)
committerThierry Reding <thierry.reding@gmail.com>
Sat, 25 May 2013 10:32:51 +0000 (12:32 +0200)
Fix to return -ENOENT in the host1x_bo lookup error handling
case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
drivers/gpu/host1x/drm/gr2d.c

index 6a45ae090ee753a46bec0aca51fe0845dbebb95c..aca72fc5e2a2b521a3206d767f40b7998454d260 100644 (file)
@@ -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,8 +160,10 @@ 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,