gpu: nvgpu: fix possible NULL dereference

Coverity id : 20260

Bug 1416640

Change-Id: I6ca8df2ed001df99ad46e476b1fe4de9f1346786
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/922362
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
This commit is contained in:
Deepak Nibade
2015-12-14 12:04:12 +05:30
committed by Sachin Nikam
parent 767f2cedfa
commit 59308073a7

View File

@@ -217,7 +217,8 @@ struct gk20a_fence *gk20a_fence_from_syncpt(struct platform_device *host1x_pdev,
f = alloc_fence(&gk20a_syncpt_fence_ops, sync_fence, wfi);
if (!f) {
#ifdef CONFIG_SYNC
sync_fence_put(sync_fence);
if (sync_fence)
sync_fence_put(sync_fence);
#endif
return NULL;
}