From 6e5a3451d4cf4f28d1eb9086d46f32210df85986 Mon Sep 17 00:00:00 2001 From: Aingara Paramakuru Date: Fri, 26 Jan 2018 12:30:28 -0500 Subject: 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 Reviewed-on: https://git-master.nvidia.com/r/1646790 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/linux/vgpu/gr_vgpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/common/linux/vgpu/gr_vgpu.c') 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) c->vm, class_num, flags); - if (!err) + if (!err) { + gr_ctx->tsgid = tsg->tsgid; err = vgpu_gr_tsg_bind_gr_ctx(tsg); + } if (err) { nvgpu_err(g, "fail to allocate TSG gr ctx buffer, err=%d", err); -- cgit v1.2.2