Commit 6aac6ced authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau: fix pin refcnt leak in failure path

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent b22870ba
......@@ -333,7 +333,9 @@ nouveau_bo_pin(struct nouveau_bo *nvbo, uint32_t memtype)
nouveau_bo_placement_set(nvbo, memtype, 0);
ret = nouveau_bo_validate(nvbo, false, false);
if (ret == 0) {
if (ret)
goto out;
switch (bo->mem.mem_type) {
case TTM_PL_VRAM:
drm->gem.vram_available -= bo->mem.size;
......@@ -344,11 +346,9 @@ nouveau_bo_pin(struct nouveau_bo *nvbo, uint32_t memtype)
default:
break;
}
}
ref_inc:
nvbo->pin_refcnt++;
out:
ttm_bo_unreserve(bo);
return ret;
......
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