mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-25 11:04:51 +03:00
gpu: nvgpu: check return value of mutex_init in CE2 code
- check return value of nvgpu_mutex_init in ce2_gk20a.c - add corresponding nvgpu_mutex_destroy calls Jira NVGPU-13 Change-Id: Iedaa4e182f23ecacf7c2c4e073317d48416ebc8f Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: http://git-master/r/1321288 Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Konsta Holtta <kholtta@nvidia.com> Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
f6f21a27b3
commit
65e2c56797
@@ -342,6 +342,7 @@ static int gk20a_ce_prepare_submit(u64 src_buf,
|
||||
int gk20a_init_ce_support(struct gk20a *g)
|
||||
{
|
||||
struct gk20a_ce_app *ce_app = &g->ce_app;
|
||||
int err;
|
||||
|
||||
if (ce_app->initialised) {
|
||||
/* assume this happen during poweron/poweroff GPU sequence */
|
||||
@@ -352,7 +353,10 @@ int gk20a_init_ce_support(struct gk20a *g)
|
||||
|
||||
gk20a_dbg(gpu_dbg_fn, "ce: init");
|
||||
|
||||
nvgpu_mutex_init(&ce_app->app_mutex);
|
||||
err = nvgpu_mutex_init(&ce_app->app_mutex);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
nvgpu_mutex_acquire(&ce_app->app_mutex);
|
||||
|
||||
INIT_LIST_HEAD(&ce_app->allocated_contexts);
|
||||
@@ -390,6 +394,7 @@ void gk20a_ce_destroy(struct gk20a *g)
|
||||
ce_app->next_ctx_id = 0;
|
||||
|
||||
nvgpu_mutex_release(&ce_app->app_mutex);
|
||||
|
||||
nvgpu_mutex_destroy(&ce_app->app_mutex);
|
||||
}
|
||||
|
||||
@@ -427,7 +432,11 @@ u32 gk20a_ce_create_context_with_cb(struct device *dev,
|
||||
if (!ce_ctx)
|
||||
return ctx_id;
|
||||
|
||||
nvgpu_mutex_init(&ce_ctx->gpu_ctx_mutex);
|
||||
err = nvgpu_mutex_init(&ce_ctx->gpu_ctx_mutex);
|
||||
if (err) {
|
||||
kfree(ce_ctx);
|
||||
return ctx_id;
|
||||
}
|
||||
|
||||
ce_ctx->g = g;
|
||||
ce_ctx->dev = g->dev;
|
||||
|
||||
Reference in New Issue
Block a user