drm/nouveau: fix pin refcnt leak in failure path
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
This commit is contained in:
parent
b22870ba6a
commit
6aac6ced4e
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue