From 77f7147ceadad87f4fc022aa51e724639af6ffb0 Mon Sep 17 00:00:00 2001 From: Olivia Lee Date: Mon, 14 Jul 2025 11:47:48 -0700 Subject: [PATCH] pan/kmod: fix propagation of MAP_FAILED in pan_kmod_bo_mmap All current callers check for MAP_FAILED, not NULL, and we are returning MAP_FAILED already on the other error paths. Fixes: d5f4f918f37 ("panfrost: clean up mmap-diagnostics") Signed-off-by: Olivia Lee Reviewed-by: Mary Guillemard Reviewed-by: Erik Faye-Lund Part-of: --- src/panfrost/lib/kmod/pan_kmod.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/panfrost/lib/kmod/pan_kmod.h b/src/panfrost/lib/kmod/pan_kmod.h index c15b2650740..bd887cf4d18 100644 --- a/src/panfrost/lib/kmod/pan_kmod.h +++ b/src/panfrost/lib/kmod/pan_kmod.h @@ -625,11 +625,9 @@ pan_kmod_bo_mmap(struct pan_kmod_bo *bo, off_t bo_offset, size_t size, int prot, host_addr = os_mmap(host_addr, size, prot, flags, bo->dev->fd, mmap_offset + bo_offset); - if (host_addr == MAP_FAILED) { + if (host_addr == MAP_FAILED) mesa_loge("mmap(..., size=%zu, prot=%d, flags=0x%x) failed: %s", size, prot, flags, strerror(errno)); - return NULL; - } return host_addr; }