From 6a2ba45e713f7ff971aa1d1bd6b33d0a14744c9a 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: (cherry picked from commit 77f7147ceadad87f4fc022aa51e724639af6ffb0) --- .pick_status.json | 2 +- src/panfrost/lib/kmod/pan_kmod.h | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 62cd135a145..80ef51cbf37 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -194,7 +194,7 @@ "description": "pan/kmod: fix propagation of MAP_FAILED in pan_kmod_bo_mmap", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "d5f4f918f37491fd9fd944230dd047575a53b24b", "notes": null diff --git a/src/panfrost/lib/kmod/pan_kmod.h b/src/panfrost/lib/kmod/pan_kmod.h index ce3bb21eb83..10092eea509 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; }