diff options
| author | Jan Beich <jbeich@FreeBSD.org> | 2024-06-10 20:31:03 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-10 22:31:03 +0200 |
| commit | 811429bfd4a46f33c7788580f72038b0c3c1c2b1 (patch) | |
| tree | 95e78563c6a83fc4afa2aacea08edc02872434dd /src/protocols/LinuxDMABUF.cpp | |
| parent | ea2501d4556f84d3de86a4ae2f4b22a474555b9f (diff) | |
wayland: consistently check mmap error after 6967a3145044 (#6402)
mmap() returns MAP_FAILED on error, not nullptr.
Diffstat (limited to 'src/protocols/LinuxDMABUF.cpp')
| -rw-r--r-- | src/protocols/LinuxDMABUF.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/protocols/LinuxDMABUF.cpp b/src/protocols/LinuxDMABUF.cpp index f7911f6e..cf8f8730 100644 --- a/src/protocols/LinuxDMABUF.cpp +++ b/src/protocols/LinuxDMABUF.cpp @@ -38,7 +38,7 @@ CCompiledDMABUFFeedback::CCompiledDMABUFFeedback(dev_t device, std::vector<SDMAB auto arr = (SDMABUFFeedbackTableEntry*)mmap(nullptr, tableLen, PROT_READ | PROT_WRITE, MAP_SHARED, fds[0], 0); - if (!arr) { + if (arr == MAP_FAILED) { LOGM(ERR, "mmap failed"); close(fds[0]); close(fds[1]); |
