From d621fe74b9ac0c27c0850df8e9a1e3721f61c1a8 Mon Sep 17 00:00:00 2001 From: Gagan Grover Date: Fri, 10 Jul 2015 13:34:30 +0530 Subject: gpu: nvgpu: Handling null pointer Handling null pointer in gk20a_fence_is_expired. Bug 200117724 Change-Id: I0f9307a5f8b82bf990b6ddaea1a408d4f3f376fb Signed-off-by: Gagan Grover Reviewed-on: http://git-master/r/777796 (cherry picked from commit dbf5bae53e0e7862754faba78eab84284786ecb3) Reviewed-on: http://git-master/r/795356 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Bharat Nihalani --- drivers/gpu/nvgpu/gk20a/fence_gk20a.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/nvgpu/gk20a/fence_gk20a.c b/drivers/gpu/nvgpu/gk20a/fence_gk20a.c index def916b3..54a288cd 100644 --- a/drivers/gpu/nvgpu/gk20a/fence_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/fence_gk20a.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -71,7 +71,10 @@ int gk20a_fence_wait(struct gk20a_fence *f, int timeout) bool gk20a_fence_is_expired(struct gk20a_fence *f) { - return f->ops->is_expired(f); + if (f && f->ops) + return f->ops->is_expired(f); + else + return true; } int gk20a_fence_install_fd(struct gk20a_fence *f) -- cgit v1.2.2