]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
video: tegra: nvmap: fix dereference before null check
authorDeepak Nibade <dnibade@nvidia.com>
Thu, 6 Feb 2014 14:05:21 +0000 (19:35 +0530)
committerSachin Nikam <snikam@nvidia.com>
Fri, 7 Feb 2014 07:04:19 +0000 (23:04 -0800)
Coverity id : 25526

Change-Id: I99c72db80445f2ddecdda563df048883ef1df31c
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/364416
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
drivers/video/tegra/nvmap/nvmap_ioctl.c

index b72709e35940d0d1ccef8ccb32c904ba9ace01dc..0d0d875805747b492df1e0bb560706b02b4d8eb0 100644 (file)
@@ -863,12 +863,13 @@ static int do_cache_maint(struct cache_maint_op *cache_work)
        phys_addr_t loop;
        int err = 0;
        struct nvmap_handle *h = cache_work->h;
-       struct nvmap_client *client = h->owner;
+       struct nvmap_client *client;
        unsigned int op = cache_work->op;
 
        if (!h || !h->alloc)
                return -EFAULT;
 
+       client = h->owner;
        if (client)
                trace_cache_maint(client, h, pstart, pend, op);
        wmb();