mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-10-29 05:40:16 -04:00
cursor: add check to ensure wl_shm_create_pool succeeded
Signed-off-by: YaoBing Xiao <xiaoyaobing@uniontech.com>
This commit is contained in:
parent
38f91fe6ad
commit
f67db75ec1
1 changed files with 5 additions and 0 deletions
|
|
@ -68,11 +68,16 @@ shm_pool_create(struct wl_shm *shm, int size)
|
|||
goto err_close;
|
||||
|
||||
pool->pool = wl_shm_create_pool(shm, pool->fd, size);
|
||||
if (!pool->pool)
|
||||
goto err_unmap;
|
||||
|
||||
pool->size = size;
|
||||
pool->used = 0;
|
||||
|
||||
return pool;
|
||||
|
||||
err_unmap:
|
||||
munmap(pool->data, size);
|
||||
err_close:
|
||||
close(pool->fd);
|
||||
err_free:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue