From 875d12c7a06bc6906bb072feb15227addec22276 Mon Sep 17 00:00:00 2001 From: Kerwin Wan Date: Fri, 11 Apr 2014 11:24:10 +0800 Subject: gpu: nvgpu: gk20a: check the return value of gk20a_channel_busy gk20a_channel_busy is called to host gpu so that gk20a can be accessed. But it may return error like if gpu fails to be powered on. Always check the return value of gk20a_channel_busy to avoid illegal access to gk20a. Bug 1488409 Change-Id: Ie22da9e436ee5ea711003530419f546a73791b73 Signed-off-by: Kerwin Wan Reviewed-on: http://git-master/r/395180 Reviewed-by: Terje Bergstrom Tested-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c b/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c index da7d733e..bc5dc4c1 100644 --- a/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c @@ -555,7 +555,9 @@ static int dbg_set_powergate(struct dbg_session_gk20a *dbg_s, gk20a_dbg(gpu_dbg_gpu_dbg | gpu_dbg_fn, "module busy"); gk20a_busy(g->dev); - gk20a_channel_busy(dbg_s->pdev); + err = gk20a_channel_busy(dbg_s->pdev); + if (err) + return -EPERM; g->ops.clock_gating.slcg_gr_load_gating_prod(g, false); -- cgit v1.2.2