From bac38f52cc6f2ddc435a748dd9c85f3c5d88153f Mon Sep 17 00:00:00 2001 From: Debarshi Dutta Date: Mon, 3 Sep 2018 10:51:02 +0530 Subject: gpu: nvgpu: protect clk_arb init with mutex. g->clk_arb is currently initialized as a part of gk20a_finalize_poweron(). Any subsequent call to gk20a_finalize_poweron reinitializes the clk_arb and leading to memory leaks. This is resolved by protecting the g->clk_arb initialization with a mutex clk_arb_enable_lock in struct gk20a. We skip initializing the g->clk_arb if its not NULL. Bug 2061372 Change-Id: I59158e0a5e4c827fdbd6d9ea2d04c78d0986347a Signed-off-by: Debarshi Dutta Reviewed-on: https://git-master.nvidia.com/r/1811650 Reviewed-by: Deepak Nibade GVS: Gerrit_Virtual_Submit Reviewed-by: Vijayakumar Subbu Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/gk20a.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.h') diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index bdf3a168..f62dfb94 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h @@ -1588,6 +1588,8 @@ struct gk20a { struct nvgpu_clk_arb *clk_arb; + struct nvgpu_mutex clk_arb_enable_lock; + struct gk20a_ce_app ce_app; bool ltc_intr_en_illegal_compstat; -- cgit v1.2.2