diff options
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/kmem.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/kmem.c b/drivers/gpu/nvgpu/common/linux/kmem.c index 04df552c..a492fb35 100644 --- a/drivers/gpu/nvgpu/common/linux/kmem.c +++ b/drivers/gpu/nvgpu/common/linux/kmem.c | |||
@@ -301,6 +301,8 @@ static int __nvgpu_free_kmem_alloc(struct nvgpu_mem_alloc_tracker *tracker, | |||
301 | return -EINVAL; | 301 | return -EINVAL; |
302 | } | 302 | } |
303 | 303 | ||
304 | memset((void *)alloc->addr, 0, alloc->size); | ||
305 | |||
304 | tracker->nr_frees++; | 306 | tracker->nr_frees++; |
305 | tracker->bytes_freed += alloc->size; | 307 | tracker->bytes_freed += alloc->size; |
306 | tracker->bytes_freed_real += alloc->real_size; | 308 | tracker->bytes_freed_real += alloc->real_size; |
@@ -415,9 +417,9 @@ void __nvgpu_track_vfree(struct gk20a *g, void *addr) | |||
415 | if (!addr) | 417 | if (!addr) |
416 | return; | 418 | return; |
417 | 419 | ||
418 | vfree(addr); | ||
419 | |||
420 | __nvgpu_free_kmem_alloc(g->vmallocs, (u64)(uintptr_t)addr); | 420 | __nvgpu_free_kmem_alloc(g->vmallocs, (u64)(uintptr_t)addr); |
421 | |||
422 | vfree(addr); | ||
421 | } | 423 | } |
422 | 424 | ||
423 | void __nvgpu_track_kfree(struct gk20a *g, void *addr) | 425 | void __nvgpu_track_kfree(struct gk20a *g, void *addr) |
@@ -425,9 +427,9 @@ void __nvgpu_track_kfree(struct gk20a *g, void *addr) | |||
425 | if (!addr) | 427 | if (!addr) |
426 | return; | 428 | return; |
427 | 429 | ||
428 | kfree(addr); | ||
429 | |||
430 | __nvgpu_free_kmem_alloc(g->kmallocs, (u64)(uintptr_t)addr); | 430 | __nvgpu_free_kmem_alloc(g->kmallocs, (u64)(uintptr_t)addr); |
431 | |||
432 | kfree(addr); | ||
431 | } | 433 | } |
432 | 434 | ||
433 | static int __do_check_for_outstanding_allocs( | 435 | static int __do_check_for_outstanding_allocs( |