compositor-fbdev: MAP_FAILED is not NULL
Fix the assumption that MAP_FAILED would be equal to NULL. It is not. Set 'fb' explicitly to NULL on mmap failure so that comparisons to NULL would produce the expected result. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
@@ -383,6 +383,7 @@ fbdev_frame_buffer_map(struct fbdev_output *output, int fd)
|
|||||||
if (output->fb == MAP_FAILED) {
|
if (output->fb == MAP_FAILED) {
|
||||||
weston_log("Failed to mmap frame buffer: %s\n",
|
weston_log("Failed to mmap frame buffer: %s\n",
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
|
output->fb = NULL;
|
||||||
goto out_close;
|
goto out_close;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user