From b18fa6c4a7867a9c0256ca2619ffa8ee04797820 Mon Sep 17 00:00:00 2001 From: Thomas Fleury Date: Tue, 24 Oct 2017 16:54:44 -0700 Subject: gpu: nvgpu: fix fault in gk20a_comptag_allocator_destroy In gk20a_comptag_allocator_destroy, allocator->g may not be initialized. This leads to a NULL pointer dereference when enabling CONFIG_NVGPU_TRACK_MEM_USAGE. Use available g parameter instead. Bug 200352099 JIRA EVLR-1959 Change-Id: I9edda516bb88cced8e7d247261e52ba6594f3b2e Signed-off-by: Thomas Fleury Reviewed-on: https://git-master.nvidia.com/r/1586504 Reviewed-by: svc-mobile-coverity GVS: Gerrit_Virtual_Submit Reviewed-by: Richard Zhao Reviewed-by: Terje Bergstrom Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/mm/comptags.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/common/mm/comptags.c') diff --git a/drivers/gpu/nvgpu/common/mm/comptags.c b/drivers/gpu/nvgpu/common/mm/comptags.c index 01ab646a..8f2fe90f 100644 --- a/drivers/gpu/nvgpu/common/mm/comptags.c +++ b/drivers/gpu/nvgpu/common/mm/comptags.c @@ -91,5 +91,5 @@ void gk20a_comptag_allocator_destroy(struct gk20a *g, * unnecessary here. */ allocator->size = 0; - nvgpu_vfree(allocator->g, allocator->bitmap); + nvgpu_vfree(g, allocator->bitmap); } -- cgit v1.2.2