summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/mm_gk20a.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/mm_gk20a.h')
-rw-r--r--drivers/gpu/nvgpu/gk20a/mm_gk20a.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h
index e07b95fe..c1f8a4f0 100644
--- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h
@@ -464,9 +464,17 @@ void gk20a_gmmu_free_attr(struct gk20a *g,
464 464
465static inline phys_addr_t gk20a_mem_phys(struct mem_desc *mem) 465static inline phys_addr_t gk20a_mem_phys(struct mem_desc *mem)
466{ 466{
467 /* the sgt may get null if this is accessed e.g. in an isr during 467 /* FIXME: the sgt/sgl may get null if this is accessed e.g. in an isr
468 * channel deletion */ 468 * during channel deletion - attempt to fix at least null derefs */
469 return mem->sgt ? sg_phys(mem->sgt->sgl) : 0; 469 struct sg_table *sgt = mem->sgt;
470
471 if (sgt) {
472 struct scatterlist *sgl = sgt->sgl;
473 if (sgl)
474 return sg_phys(sgl);
475 }
476
477 return 0;
470} 478}
471 479
472u64 gk20a_locked_gmmu_map(struct vm_gk20a *vm, 480u64 gk20a_locked_gmmu_map(struct vm_gk20a *vm,