From 601a5f8ed22154cb93ecb8865cbcfdeb32e3292b Mon Sep 17 00:00:00 2001 From: Konsta Holtta Date: Tue, 21 Jun 2016 09:31:01 +0300 Subject: 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 Reviewed-on: http://git-master/r/1168441 GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/channel_gk20a.c') 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, /* wrap-around */ int length0 = gpfifo_size - start; int length1 = len - length0; - void *user2 = (u8*)user_gpfifo + length0; + void __user *user2 = (u8 __user *)user_gpfifo + length0; err = copy_from_user(gpfifo_mem->cpu_va + start, user_gpfifo, length0); @@ -2130,7 +2130,7 @@ int gk20a_submit_channel_gpfifo(struct channel_gk20a *c, bool need_sync_fence = false; bool new_sync_created = false; struct nvgpu_gpfifo __user *user_gpfifo = args ? - (struct nvgpu_gpfifo __user *)(uintptr_t)args->gpfifo : 0; + (struct nvgpu_gpfifo __user *)(uintptr_t)args->gpfifo : NULL; /* * If user wants to allocate sync_fence_fd always, then respect that; -- cgit v1.2.2