diff options
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/dma.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/dma.c b/drivers/gpu/nvgpu/common/linux/dma.c index c13dae8b..c111d22b 100644 --- a/drivers/gpu/nvgpu/common/linux/dma.c +++ b/drivers/gpu/nvgpu/common/linux/dma.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. | 2 | * Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved. |
3 | * | 3 | * |
4 | * This program is free software; you can redistribute it and/or modify it | 4 | * This program is free software; you can redistribute it and/or modify it |
5 | * under the terms and conditions of the GNU General Public License, | 5 | * under the terms and conditions of the GNU General Public License, |
@@ -221,6 +221,11 @@ int nvgpu_dma_alloc_flags_sys(struct gk20a *g, unsigned long flags, | |||
221 | NVGPU_DEFINE_DMA_ATTRS(dma_attrs); | 221 | NVGPU_DEFINE_DMA_ATTRS(dma_attrs); |
222 | void *alloc_ret; | 222 | void *alloc_ret; |
223 | 223 | ||
224 | if (nvgpu_mem_is_valid(mem)) { | ||
225 | nvgpu_warn(g, "memory leak !!"); | ||
226 | WARN_ON(1); | ||
227 | } | ||
228 | |||
224 | /* | 229 | /* |
225 | * Before the debug print so we see this in the total. But during | 230 | * Before the debug print so we see this in the total. But during |
226 | * cleanup in the fail path this has to be subtracted. | 231 | * cleanup in the fail path this has to be subtracted. |
@@ -297,6 +302,11 @@ int nvgpu_dma_alloc_flags_vid_at(struct gk20a *g, unsigned long flags, | |||
297 | &g->mm.vidmem.bootstrap_allocator; | 302 | &g->mm.vidmem.bootstrap_allocator; |
298 | int before_pending; | 303 | int before_pending; |
299 | 304 | ||
305 | if (nvgpu_mem_is_valid(mem)) { | ||
306 | nvgpu_warn(g, "memory leak !!"); | ||
307 | WARN_ON(1); | ||
308 | } | ||
309 | |||
300 | dma_dbg_alloc(g, size, flags, "vidmem"); | 310 | dma_dbg_alloc(g, size, flags, "vidmem"); |
301 | 311 | ||
302 | mem->size = size; | 312 | mem->size = size; |