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: d5f4f918f3 ("panfrost: clean up mmap-diagnostics")
Signed-off-by: Olivia Lee <olivia.lee@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36122>
This commit is contained in:
Olivia Lee 2025-07-14 11:47:48 -07:00 committed by Marge Bot
parent 7dcac3d55b
commit 77f7147cea

View file

@ -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;
}