Merge "msm:ADSPRPC :Fix to avoid Use after free in fastrpc_internal_munmap"

This commit is contained in:
qctecmdr 2021-03-27 21:12:48 -07:00 • committed by Gerrit - the friendly Code Review server
commit a1a010ce09

View file

@ -4498,8 +4498,13 @@ static int fastrpc_internal_munmap(struct fastrpc_file *fl,
mutex_unlock(&fl->map_mutex);
if (err)
goto bail;
VERIFY(err, map != NULL);
if (err) {
err = -EINVAL;
goto bail;
}
VERIFY(err, !(err = fastrpc_munmap_on_dsp(fl, map->raddr,
map->phys, map->size, map->flags)));
map->phys, map->size, map->flags)));
if (err)
goto bail;
mutex_lock(&fl->map_mutex);