summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/linux/vgpu/gr_vgpu.c
diff options
context:
space:
mode:
authorAingara Paramakuru <aparamakuru@nvidia.com>2018-01-26 12:30:28 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2018-01-31 05:41:16 -0500
commit6e5a3451d4cf4f28d1eb9086d46f32210df85986 (patch)
treeff3e4013fd5e32e874f0ced4cd791d840a3dfe3b /drivers/gpu/nvgpu/common/linux/vgpu/gr_vgpu.c
parenta55e3e361def6465a37f29b8e2bb7a8bf943dd16 (diff)
gpu: nvgpu: vgpu: fix resource leak
gr_ctx->tsgid needs to be set to ensure that the GR ctx free sequence will target the correct TSG's GR ctx. Bug 200341631 Change-Id: I83c57597f10ce3af572f114d28312376cea55c2a Signed-off-by: Aingara Paramakuru <aparamakuru@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1646790 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux/vgpu/gr_vgpu.c')
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/gr_vgpu.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/vgpu/gr_vgpu.c b/drivers/gpu/nvgpu/common/linux/vgpu/gr_vgpu.c
index 1fd3e34f..66e40647 100644
--- a/drivers/gpu/nvgpu/common/linux/vgpu/gr_vgpu.c
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/gr_vgpu.c
@@ -499,8 +499,10 @@ int vgpu_gr_alloc_obj_ctx(struct channel_gk20a *c, u32 class_num, u32 flags)
499 c->vm, 499 c->vm,
500 class_num, 500 class_num,
501 flags); 501 flags);
502 if (!err) 502 if (!err) {
503 gr_ctx->tsgid = tsg->tsgid;
503 err = vgpu_gr_tsg_bind_gr_ctx(tsg); 504 err = vgpu_gr_tsg_bind_gr_ctx(tsg);
505 }
504 if (err) { 506 if (err) {
505 nvgpu_err(g, 507 nvgpu_err(g,
506 "fail to allocate TSG gr ctx buffer, err=%d", err); 508 "fail to allocate TSG gr ctx buffer, err=%d", err);