From 8282b72a0447fbf5fe31204943189ee843c47d38 Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Mon, 31 Dec 2018 20:04:22 +0530 Subject: gpu: nvgpu: fix channel reference leak in error case In gr_gp10b_get_cilp_preempt_pending_chid(), we leak the channel reference if tsg_gk20a_from_ch() returns NULL Fix this by calling gk20a_channel_put() in error case Bug 2444819 Jira NVGPU-1601 Change-Id: Ic5d036c6d043b0b95dd2a564afcc0add67c1ca02 Signed-off-by: Deepak Nibade Reviewed-on: https://git-master.nvidia.com/r/1984953 (cherry picked from commit 2322cb131c3478c1a7e3d8b29810f1c7001d4c44) Reviewed-on: https://git-master.nvidia.com/r/2077312 GVS: Gerrit_Virtual_Submit Reviewed-by: Bharat Nihalani Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gp10b/gr_gp10b.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/gpu/nvgpu/gp10b') diff --git a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c index 8d02c8f6..4d7c6d69 100644 --- a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c @@ -1969,6 +1969,7 @@ static int gr_gp10b_get_cilp_preempt_pending_chid(struct gk20a *g, int *__chid) tsg = tsg_gk20a_from_ch(ch); if (!tsg) { + gk20a_channel_put(ch); return -EINVAL; } -- cgit v1.2.2