summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
diff options
context:
space:
mode:
authorKonsta Holtta <kholtta@nvidia.com>2016-06-21 02:31:01 -0400
committerTerje Bergstrom <tbergstrom@nvidia.com>2016-06-21 12:49:28 -0400
commit601a5f8ed22154cb93ecb8865cbcfdeb32e3292b (patch)
tree06e80c1f80398ae0ea9b7125551b2b56811e382e /drivers/gpu/nvgpu/gk20a/channel_gk20a.c
parent27baafaad1a5c999642939faef63cacab17c9ed6 (diff)
gpu: nvgpu: Sparse fixes in gpfifo_mem user gpfifo
1) Keep the __user tag in the type of the user gpfifo when copying, 2) use NULL instead of 0 for initializing user_gpfifo pointer. Bug 200067946 Change-Id: I631b4bca44ded0900204134338fa1d62d0017df0 Signed-off-by: Konsta Holtta <kholtta@nvidia.com> Reviewed-on: http://git-master/r/1168441 GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman <alexw@nvidia.com> Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/channel_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/channel_gk20a.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
index cc097ae4..db0f746f 100644
--- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
@@ -2047,7 +2047,7 @@ static int gk20a_submit_append_gpfifo(struct channel_gk20a *c,
2047 /* wrap-around */ 2047 /* wrap-around */
2048 int length0 = gpfifo_size - start; 2048 int length0 = gpfifo_size - start;
2049 int length1 = len - length0; 2049 int length1 = len - length0;
2050 void *user2 = (u8*)user_gpfifo + length0; 2050 void __user *user2 = (u8 __user *)user_gpfifo + length0;
2051 2051
2052 err = copy_from_user(gpfifo_mem->cpu_va + start, 2052 err = copy_from_user(gpfifo_mem->cpu_va + start,
2053 user_gpfifo, length0); 2053 user_gpfifo, length0);
@@ -2130,7 +2130,7 @@ int gk20a_submit_channel_gpfifo(struct channel_gk20a *c,
2130 bool need_sync_fence = false; 2130 bool need_sync_fence = false;
2131 bool new_sync_created = false; 2131 bool new_sync_created = false;
2132 struct nvgpu_gpfifo __user *user_gpfifo = args ? 2132 struct nvgpu_gpfifo __user *user_gpfifo = args ?
2133 (struct nvgpu_gpfifo __user *)(uintptr_t)args->gpfifo : 0; 2133 (struct nvgpu_gpfifo __user *)(uintptr_t)args->gpfifo : NULL;
2134 2134
2135 /* 2135 /*
2136 * If user wants to allocate sync_fence_fd always, then respect that; 2136 * If user wants to allocate sync_fence_fd always, then respect that;