From 8408cce303e8517934b7f92d8ef302a82118d6a4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marcin=20=C5=9Alusarz?= Date: Thu, 2 Sep 2021 10:46:52 +0200 Subject: [PATCH] vulkan/wsi/x11: fix shm allocation control flow issue MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit shmget returns -1 on error. alloc_shm assigns it to an unsigned variable and then checks whether it's < 0, which will never be true. Found by Coverity. CID: 1490891 Fixes: 1f55f9a97a5 ("vulkan/wsi/sw: add support for using host_ptr for shm pixmaps.") Signed-off-by: Marcin Ślusarz Reviewed-by: Dave Airlie Part-of: --- src/vulkan/wsi/wsi_common_x11.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vulkan/wsi/wsi_common_x11.c b/src/vulkan/wsi/wsi_common_x11.c index bb6adeb..fcda05d 100644 --- a/src/vulkan/wsi/wsi_common_x11.c +++ b/src/vulkan/wsi/wsi_common_x11.c @@ -834,7 +834,7 @@ struct x11_image { uint32_t sync_fence; uint32_t serial; xcb_shm_seg_t shmseg; - uint32_t shmid; + int shmid; uint8_t * shmaddr; }; -- 2.7.4