vc4->bo_stats.num_allocated--;
vc4->bo_stats.size_allocated -= obj->size;
- if (bo->resv == &bo->_resv)
- reservation_object_fini(bo->resv);
+ reservation_object_fini(&bo->_resv);
drm_gem_cma_free_object(obj);
}
vc4->bo_stats.num_allocated++;
vc4->bo_stats.size_allocated += size;
mutex_unlock(&vc4->bo_lock);
+ bo->resv = &bo->_resv;
+ reservation_object_init(bo->resv);
return &bo->base.base;
}
return ERR_PTR(-ENOMEM);
}
}
- bo = to_vc4_bo(&cma_obj->base);
-
- bo->resv = &bo->_resv;
- reservation_object_init(bo->resv);
-
- return bo;
+ return to_vc4_bo(&cma_obj->base);
}
int vc4_dumb_create(struct drm_file *file_priv,