[PATCH 6.6.y 0/5] fix error handling in mmap_region() and refactor (hotfixes)