summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gr_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gr_gk20a.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
index 661a2ca3..69fe4901 100644
--- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
@@ -2269,7 +2269,10 @@ static void gk20a_gr_destroy_ctx_buffer(struct platform_device *pdev,
2269 struct gr_ctx_buffer_desc *desc) 2269 struct gr_ctx_buffer_desc *desc)
2270{ 2270{
2271 struct device *dev = &pdev->dev; 2271 struct device *dev = &pdev->dev;
2272 gk20a_free_sgtable(&desc->sgt); 2272 if (!desc)
2273 return;
2274 if (desc->sgt)
2275 gk20a_free_sgtable(&desc->sgt);
2273 dma_free_attrs(dev, desc->size, desc->pages, 2276 dma_free_attrs(dev, desc->size, desc->pages,
2274 desc->iova, &desc->attrs); 2277 desc->iova, &desc->attrs);
2275} 2278}