[igt-dev] [PATCH v3 02/10] lib/panfrost: Handle the NULL case in igt_panfrost_free_bo()
Boris Brezillon
boris.brezillon at collabora.com
Fri Jun 25 14:01:10 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>
Reviewed-by: Alyssa Rosenzweig <alyssa 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