summaryrefslogtreecommitdiff
path: root/lib/igt_panfrost.c
diff options
context:
space:
mode:
authorBoris Brezillon <boris.brezillon@collabora.com>2021-06-21 11:44:36 +0200
committerBoris Brezillon <boris.brezillon@collabora.com>2021-06-28 10:04:30 +0200
commit090874b44b1b31bdcccb66e1a0c94910cb946499 (patch)
treee13c86371168fa1fbaa6267efe1322ae0b2b4950 /lib/igt_panfrost.c
parentd488d7f3dff14df5c077c360f13ef129eea7de77 (diff)
lib/panfrost: Handle the NULL case in igt_panfrost_free_bo()
So we don't have to bother checking the value before calling this function. v2: * No changes Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Diffstat (limited to 'lib/igt_panfrost.c')
-rw-r--r--lib/igt_panfrost.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/igt_panfrost.c b/lib/igt_panfrost.c
index 8b0c2b774..4bbb5ddf4 100644
--- a/lib/igt_panfrost.c
+++ b/lib/igt_panfrost.c
@@ -72,6 +72,9 @@ igt_panfrost_gem_new(int fd, size_t size)
void
igt_panfrost_free_bo(int fd, struct panfrost_bo *bo)
{
+ if (!bo)
+ return;
+
if (bo->map)
munmap(bo->map, bo->size);
gem_close(fd, bo->handle);