From bf717d6273fa2d618dd2adf9bc349881f599e102 Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Wed, 8 Mar 2017 15:20:58 +0530 Subject: gpu: nvgpu: check return value of mutex_init for channel/TSG - check return value of nvgpu_mutex_init for all the mutexes of a channel and TSG - add corresponding nvgpu_mutex_destroy calls Jira NVGPU-13 Change-Id: Iba3a5f8bc2261ec684b300dd4237ab7d22fa3630 Signed-off-by: Deepak Nibade Reviewed-on: http://git-master/r/1317139 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/fifo_gk20a.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'drivers/gpu/nvgpu/gk20a/fifo_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c index 04d68872..a2846d2a 100644 --- a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c @@ -513,6 +513,7 @@ static void gk20a_remove_fifo_support(struct fifo_gk20a *f) */ for (; i < f->num_channels; i++) { struct channel_gk20a *c = f->channel + i; + struct tsg_gk20a *tsg = f->tsg + i; /* * Could race but worst that happens is we get an error message @@ -520,6 +521,21 @@ static void gk20a_remove_fifo_support(struct fifo_gk20a *f) */ if (c->referenceable) __gk20a_channel_kill(c); + + nvgpu_mutex_destroy(&tsg->event_id_list_lock); + + nvgpu_mutex_destroy(&c->ioctl_lock); + nvgpu_mutex_destroy(&c->error_notifier_mutex); + nvgpu_mutex_destroy(&c->joblist.cleanup_lock); + nvgpu_mutex_destroy(&c->joblist.pre_alloc.read_lock); + nvgpu_mutex_destroy(&c->sync_lock); +#if defined(CONFIG_GK20A_CYCLE_STATS) + nvgpu_mutex_destroy(&c->cyclestate.cyclestate_buffer_mutex); + nvgpu_mutex_destroy(&c->cs_client_mutex); +#endif + nvgpu_mutex_destroy(&c->event_id_list_lock); + nvgpu_mutex_destroy(&c->dbg_s_lock); + } vfree(f->channel); -- cgit v1.2.2