mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-23 18:16:01 +03:00
gpu: nvgpu: check return value of mutex_init in clk_arb.c
- check return value of nvgpu_mutex_init in clk_arb.c - add corresponding nvgpu_mutex_destroy calls Jira NVGPU-13 Change-Id: I823888ec234ce5358187c449de8e6cabc5fc5503 Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: http://git-master/r/1317133 Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-by: Navneet Kumar <navneetk@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
de568db9de
commit
d6150fa12c
@@ -267,10 +267,14 @@ int nvgpu_clk_arb_init_arbiter(struct gk20a *g)
|
||||
return 0;
|
||||
|
||||
arb = kzalloc(sizeof(struct nvgpu_clk_arb), GFP_KERNEL);
|
||||
if (!arb) {
|
||||
err = -ENOMEM;
|
||||
goto init_fail;
|
||||
}
|
||||
if (!arb)
|
||||
return -ENOMEM;
|
||||
|
||||
err = nvgpu_mutex_init(&arb->pstate_lock);
|
||||
if (err)
|
||||
goto mutex_fail;
|
||||
nvgpu_spinlock_init(&arb->sessions_lock);
|
||||
nvgpu_spinlock_init(&arb->users_lock);
|
||||
|
||||
arb->mclk_f_points = kcalloc(MAX_F_POINTS, sizeof(u16), GFP_KERNEL);
|
||||
if (!arb->mclk_f_points) {
|
||||
@@ -308,10 +312,6 @@ int nvgpu_clk_arb_init_arbiter(struct gk20a *g)
|
||||
g->clk_arb = arb;
|
||||
arb->g = g;
|
||||
|
||||
nvgpu_mutex_init(&arb->pstate_lock);
|
||||
nvgpu_spinlock_init(&arb->sessions_lock);
|
||||
nvgpu_spinlock_init(&arb->users_lock);
|
||||
|
||||
err = g->ops.clk_arb.get_arbiter_clk_default(g,
|
||||
CTRL_CLK_DOMAIN_MCLK, &default_mhz);
|
||||
if (err < 0) {
|
||||
@@ -382,7 +382,6 @@ int nvgpu_clk_arb_init_arbiter(struct gk20a *g)
|
||||
|
||||
init_fail:
|
||||
|
||||
if (arb) {
|
||||
kfree(arb->gpc2clk_f_points);
|
||||
kfree(arb->mclk_f_points);
|
||||
|
||||
@@ -390,8 +389,10 @@ init_fail:
|
||||
kfree(arb->vf_table_pool[index].gpc2clk_points);
|
||||
kfree(arb->vf_table_pool[index].mclk_points);
|
||||
}
|
||||
}
|
||||
|
||||
nvgpu_mutex_destroy(&arb->pstate_lock);
|
||||
|
||||
mutex_fail:
|
||||
kfree(arb);
|
||||
|
||||
return err;
|
||||
@@ -454,6 +455,7 @@ static void nvgpu_clk_arb_set_global_alarm(struct gk20a *g, u32 alarm)
|
||||
|
||||
void nvgpu_clk_arb_cleanup_arbiter(struct gk20a *g)
|
||||
{
|
||||
nvgpu_mutex_destroy(&g->clk_arb->pstate_lock);
|
||||
kfree(g->clk_arb);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user