From ba0c63dee86cf94272c7763d711695fe3af0f210 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Wed, 2 Jun 2021 16:22:54 +0200 Subject: [PATCH] shm: remove wl_shm_buffer.pool NULL checks wl_shm_buffer.pool is never set to NULL. The only time it's set is in shm_pool_create_buffer, and the pool is guaranteed to be non-NULL there. Signed-off-by: Simon Ser --- src/wayland-shm.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/wayland-shm.c b/src/wayland-shm.c index 7320bc99..aa64ff38 100644 --- a/src/wayland-shm.c +++ b/src/wayland-shm.c @@ -124,8 +124,7 @@ destroy_buffer(struct wl_resource *resource) { struct wl_shm_buffer *buffer = wl_resource_get_user_data(resource); - if (buffer->pool) - shm_pool_unref(buffer->pool, false); + shm_pool_unref(buffer->pool, false); free(buffer); } @@ -400,11 +399,6 @@ wl_shm_buffer_get_stride(struct wl_shm_buffer *buffer) WL_EXPORT void * wl_shm_buffer_get_data(struct wl_shm_buffer *buffer) { - assert(buffer->pool); - - if (!buffer->pool) - return NULL; - if (buffer->pool->external_refcount && (buffer->pool->size != buffer->pool->new_size)) wl_log("Buffer address requested when its parent pool "