From 090874b44b1b31bdcccb66e1a0c94910cb946499 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Mon, 21 Jun 2021 11:44:36 +0200 Subject: 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 Reviewed-by: Alyssa Rosenzweig --- lib/igt_panfrost.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/igt_panfrost.c') 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); -- cgit v1.2.3