Allows us to pass BOs without checking if they're NULL or not.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
void
panfrost_bo_reference(struct panfrost_bo *bo)
{
- pipe_reference(NULL, &bo->reference);
+ if (bo)
+ pipe_reference(NULL, &bo->reference);
}
void
panfrost_bo_unreference(struct pipe_screen *screen, struct panfrost_bo *bo)
{
+ if (!bo)
+ return;
+
/* When the reference count goes to zero, we need to cleanup */
if (pipe_reference(&bo->reference, NULL))