[igt-dev] [PATCH v2 2/8] lib/panfrost: Handle the NULL case in igt_panfrost_free_bo()

Boris Brezillon boris.brezillon at collabora.com
Tue Jun 22 09:02:15 UTC 2021


So we don't have to bother checking the value before calling this
function.

v2:
* No changes

Signed-off-by: Boris Brezillon <boris.brezillon at collabora.com>
---
 lib/igt_panfrost.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/igt_panfrost.c b/lib/igt_panfrost.c
index 8b0c2b7743ea..4bbb5ddf4076 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);
-- 
2.31.1



More information about the igt-dev mailing list