Commit ad99cb5e authored by Dan Carpenter's avatar Dan Carpenter Committed by Lucas Stach

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: 088880dd ("drm/etnaviv: implement softpin")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarLucas Stach <l.stach@pengutronix.de>
parent 40b697e2
...@@ -238,8 +238,10 @@ static int submit_pin_objects(struct etnaviv_gem_submit *submit) ...@@ -238,8 +238,10 @@ static int submit_pin_objects(struct etnaviv_gem_submit *submit)
} }
if ((submit->flags & ETNA_SUBMIT_SOFTPIN) && 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; return -EINVAL;
}
atomic_inc(&etnaviv_obj->gpu_active); atomic_inc(&etnaviv_obj->gpu_active);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment