summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorBoris Brezillon <[email protected]>2019-08-02 19:18:47 +0200
committerBoris Brezillon <[email protected]>2019-08-02 21:54:58 +0200
commited501c00cb6c723b13e10f10b02f9c675fc23d98 (patch)
tree81745ad5d293773c41457c8109a67e986f45cf2e /src/gallium/drivers
parent12f72175f3e9f41cb4cbca5fe17e6339555f9ead (diff)
panfrost: Handle the bo == NULL case in panfrost_bo_[un]reference()
Allows us to pass BOs without checking if they're NULL or not. Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/panfrost/pan_resource.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gallium/drivers/panfrost/pan_resource.c b/src/gallium/drivers/panfrost/pan_resource.c
index 71da383d4c7..f74a39555b4 100644
--- a/src/gallium/drivers/panfrost/pan_resource.c
+++ b/src/gallium/drivers/panfrost/pan_resource.c
@@ -443,12 +443,16 @@ panfrost_resource_create(struct pipe_screen *screen,
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))