From c4facdc0586896eda4fb06af40dbdff973dd5e57 Mon Sep 17 00:00:00 2001 From: Philip Elcan Date: Wed, 10 Apr 2019 17:18:00 -0400 Subject: [PATCH] gpu: nvgpu: unit: fix valgrind erros in page_table Fix cases where valgrind detected "conditional jump or move depends on uninitialised value(s)" JIRA NVGPU-3098 Change-Id: I999b61e35da4136406941e2fb928fd2e693386d9 Signed-off-by: Philip Elcan Reviewed-on: https://git-master.nvidia.com/r/2094641 Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-misra Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Thomas Fleury Reviewed-by: Alex Waterman Reviewed-by: mobile promotions Tested-by: mobile promotions --- userspace/units/mm/gmmu/page_table/page_table.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/userspace/units/mm/gmmu/page_table/page_table.c b/userspace/units/mm/gmmu/page_table/page_table.c index a53264c99..1e9800bae 100644 --- a/userspace/units/mm/gmmu/page_table/page_table.c +++ b/userspace/units/mm/gmmu/page_table/page_table.c @@ -548,7 +548,7 @@ static int test_nvgpu_gmmu_map_unmap(struct unit_module *m, static int test_nvgpu_gmmu_map_unmap_map_fail(struct unit_module *m, struct gk20a *g, void *args) { - struct nvgpu_mem mem; + struct nvgpu_mem mem = { }; struct nvgpu_posix_fault_inj *kmem_fi = nvgpu_kmem_get_fault_injection(); struct nvgpu_os_posix *p = nvgpu_os_posix_from_gk20a(g); @@ -858,7 +858,7 @@ static int test_nvgpu_gmmu_map_unmap_batched(struct unit_module *m, { struct nvgpu_mem mem = { }, mem2 = { }; u64 vaddr, vaddr2; - struct vm_gk20a_mapping_batch batch; + struct vm_gk20a_mapping_batch batch = { }; struct nvgpu_sgt *sgt; struct test_parameters *params = (struct test_parameters *) args;