summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/clk/clk_arb.c
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2016-12-20 18:53:26 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2017-01-04 04:44:25 -0500
commit7feff293e4f88ddae92ccf05ff86386c8d1f5c0e (patch)
tree4a3c0d1528faca9df15964db0685ba500c9739f7 /drivers/gpu/nvgpu/clk/clk_arb.c
parent685b4d351ed413b19261be3e884bf182bf1a0e7f (diff)
gpu: nvgpu: Free arb substructures only if arb allocated
nvgpu_clk_arb_init_arbiter() allocates master structure arb, and sub-structures which is assigns as members of arb. At failure, there's a single error label, and it tries to free the members of arb without checking that arb was allocated. Change-Id: Ifac7552b05dad17036835eb3ee624eae351ccb7d Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/1279226 GVS: Gerrit_Virtual_Submit Reviewed-by: Thomas Fleury <tfleury@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/clk/clk_arb.c')
-rw-r--r--drivers/gpu/nvgpu/clk/clk_arb.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/clk/clk_arb.c b/drivers/gpu/nvgpu/clk/clk_arb.c
index e8213b47..e4f658f6 100644
--- a/drivers/gpu/nvgpu/clk/clk_arb.c
+++ b/drivers/gpu/nvgpu/clk/clk_arb.c
@@ -296,12 +296,14 @@ int nvgpu_clk_arb_init_arbiter(struct gk20a *g)
296 296
297init_fail: 297init_fail:
298 298
299 kfree(arb->gpc2clk_f_points); 299 if (arb) {
300 kfree(arb->mclk_f_points); 300 kfree(arb->gpc2clk_f_points);
301 kfree(arb->mclk_f_points);
301 302
302 for (index = 0; index < 2; index++) { 303 for (index = 0; index < 2; index++) {
303 kfree(arb->vf_table_pool[index].gpc2clk_points); 304 kfree(arb->vf_table_pool[index].gpc2clk_points);
304 kfree(arb->vf_table_pool[index].mclk_points); 305 kfree(arb->vf_table_pool[index].mclk_points);
306 }
305 } 307 }
306 308
307 kfree(arb); 309 kfree(arb);