1
0
Fork 0

drm/etnaviv: Fix a leak in submit_pin_objects()

If the mapping address is wrong then we have to release the reference to
it before returning -EINVAL.

Fixes: 088880ddc0 ("drm/etnaviv: implement softpin")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
alistair/sunxi64-5.7-dsi
Dan Carpenter 2020-05-18 14:29:55 +03:00 committed by Lucas Stach
parent 40b697e256
commit ad99cb5e78
1 changed files with 3 additions and 1 deletions

View File

@ -238,8 +238,10 @@ static int submit_pin_objects(struct etnaviv_gem_submit *submit)
}
if ((submit->flags & ETNA_SUBMIT_SOFTPIN) &&
submit->bos[i].va != mapping->iova)
submit->bos[i].va != mapping->iova) {
etnaviv_gem_mapping_unreference(mapping);
return -EINVAL;
}
atomic_inc(&etnaviv_obj->gpu_active);