diff --git a/drivers/gpu/nvgpu/include/nvgpu/kmem.h b/drivers/gpu/nvgpu/include/nvgpu/kmem.h index 591925252..f490711c2 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/kmem.h +++ b/drivers/gpu/nvgpu/include/nvgpu/kmem.h @@ -292,10 +292,10 @@ static inline void nvgpu_big_free(struct gk20a *g, void *p) * nvgpu_big_[mz]alloc() will need to remember the size of the alloc * when freeing. */ - if (virt_addr_valid(p)) - nvgpu_kfree(g, p); - else + if (is_vmalloc_addr(p)) nvgpu_vfree(g, p); + else + nvgpu_kfree(g, p); } #endif /* __NVGPU_KMEM_H__ */