diff --git a/drivers/char/adsprpc.c b/drivers/char/adsprpc.c index 8e7b4eff7325..9268f39cb328 100644 --- a/drivers/char/adsprpc.c +++ b/drivers/char/adsprpc.c @@ -4959,6 +4959,7 @@ static int fastrpc_internal_mem_map(struct fastrpc_file *fl, int err = 0; struct fastrpc_mmap *map = NULL; + mutex_lock(&fl->internal_map_mutex); VERIFY(err, fl->dsp_proc_init == 1); if (err) { pr_err("adsprpc: ERROR: %s: user application %s trying to map without initialization\n", @@ -4997,6 +4998,7 @@ bail: mutex_unlock(&fl->map_mutex); } } + mutex_unlock(&fl->internal_map_mutex); return err; } @@ -5006,6 +5008,7 @@ static int fastrpc_internal_mem_unmap(struct fastrpc_file *fl, int err = 0; struct fastrpc_mmap *map = NULL; + mutex_lock(&fl->internal_map_mutex); VERIFY(err, fl->dsp_proc_init == 1); if (err) { pr_err("adsprpc: ERROR: %s: user application %s trying to map without initialization\n", @@ -5051,6 +5054,7 @@ bail: mutex_unlock(&fl->map_mutex); } } + mutex_unlock(&fl->internal_map_mutex); return err; }