From 5ccaaa73af4683eabd4d135b5b08aec4a206b613 Mon Sep 17 00:00:00 2001 From: Richard Zhao Date: Mon, 25 Apr 2016 11:36:52 -0700 Subject: gpu: nvgpu: vgpu: fix Oops when dt have no mempool-fecs-trace Avoid unreserving mempool when it didn't reserve successfully. Bug 1757733 Change-Id: I39d36492a54c2e71afff3221505196a463c06776 Signed-off-by: Richard Zhao Reviewed-on: http://git-master/r/1132057 (cherry picked from commit b18060ea30b924c4ef39c05a70d4f03759061128) Reviewed-on: http://git-master/r/1132129 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/vgpu/fecs_trace_vgpu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/gpu/nvgpu/vgpu/fecs_trace_vgpu.c b/drivers/gpu/nvgpu/vgpu/fecs_trace_vgpu.c index 02e0baad..bd1a7451 100644 --- a/drivers/gpu/nvgpu/vgpu/fecs_trace_vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/fecs_trace_vgpu.c @@ -58,6 +58,7 @@ static int vgpu_fecs_trace_init(struct gk20a *g) if (IS_ERR(vcst->cookie)) { dev_info(dev_from_gk20a(g), "mempool %u reserve failed\n", mempool); + vcst->cookie = NULL; err = -EINVAL; goto fail; } @@ -85,7 +86,7 @@ static int vgpu_fecs_trace_init(struct gk20a *g) return 0; fail: iounmap(vcst->buf); - if (!IS_ERR(vcst->cookie)) + if (vcst->cookie) tegra_hv_mempool_unreserve(vcst->cookie); kfree(vcst); return err; -- cgit v1.2.2