diff options
author | Deepak Nibade <dnibade@nvidia.com> | 2018-12-31 09:34:22 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2019-04-01 12:12:25 -0400 |
commit | 8282b72a0447fbf5fe31204943189ee843c47d38 (patch) | |
tree | 620200b89a8a872e0682bf14a71d9e39f880f810 /drivers/gpu/nvgpu | |
parent | 9e329ca39b64b9c96d1db70d750c287166af92d1 (diff) |
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 <dnibade@nvidia.com>
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 <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu')
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/gr_gp10b.c | 1 |
1 files changed, 1 insertions, 0 deletions
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) | |||
1969 | 1969 | ||
1970 | tsg = tsg_gk20a_from_ch(ch); | 1970 | tsg = tsg_gk20a_from_ch(ch); |
1971 | if (!tsg) { | 1971 | if (!tsg) { |
1972 | gk20a_channel_put(ch); | ||
1972 | return -EINVAL; | 1973 | return -EINVAL; |
1973 | } | 1974 | } |
1974 | 1975 | ||