wayland: consistently check mmap error after 6967a31450 (#6402)

mmap() returns MAP_FAILED on error, not nullptr.
This commit is contained in:
Jan Beich
2024-06-10 20:31:03 +00:00
committed by GitHub
parent ea2501d455
commit 811429bfd4
2 changed files with 3 additions and 3 deletions

View File

@@ -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]);