mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 02:22:34 +03:00
gpu: nvgpu: check return value of mutex_init in ctxsw_trace_gk20a.c
- check return value of nvgpu_mutex_init in ctxsw_trace_gk20a.c - add corresponding nvgpu_mutex_destroy calls Jira NVGPU-13 Change-Id: I7075c6f742dba7ad4c559fedb80a3a96e824db56 Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: http://git-master/r/1317134 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
d6150fa12c
commit
ce810756ba
@@ -475,6 +475,7 @@ static int gk20a_ctxsw_init_devs(struct gk20a *g)
|
||||
{
|
||||
struct gk20a_ctxsw_trace *trace = g->ctxsw_trace;
|
||||
struct gk20a_ctxsw_dev *dev = trace->devs;
|
||||
int err;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < GK20A_CTXSW_TRACE_NUM_DEVS; i++) {
|
||||
@@ -482,7 +483,9 @@ static int gk20a_ctxsw_init_devs(struct gk20a *g)
|
||||
dev->hdr = NULL;
|
||||
dev->write_enabled = false;
|
||||
init_waitqueue_head(&dev->readout_wq);
|
||||
nvgpu_mutex_init(&dev->write_lock);
|
||||
err = nvgpu_mutex_init(&dev->write_lock);
|
||||
if (err)
|
||||
return err;
|
||||
atomic_set(&dev->vma_ref, 0);
|
||||
dev++;
|
||||
}
|
||||
@@ -533,9 +536,21 @@ fail:
|
||||
void gk20a_ctxsw_trace_cleanup(struct gk20a *g)
|
||||
{
|
||||
#ifdef CONFIG_GK20A_CTXSW_TRACE
|
||||
struct gk20a_ctxsw_trace *trace;
|
||||
struct gk20a_ctxsw_dev *dev;
|
||||
int i;
|
||||
|
||||
if (!g->ctxsw_trace)
|
||||
return;
|
||||
|
||||
trace = g->ctxsw_trace;
|
||||
dev = trace->devs;
|
||||
|
||||
for (i = 0; i < GK20A_CTXSW_TRACE_NUM_DEVS; i++) {
|
||||
nvgpu_mutex_destroy(&dev->write_lock);
|
||||
dev++;
|
||||
}
|
||||
|
||||
kfree(g->ctxsw_trace);
|
||||
g->ctxsw_trace = NULL;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user