Resolve segfault in wsialloc_delete
authorDennis Tsiang <dennis.tsiang@arm.com>
Wed, 5 May 2021 14:44:32 +0000 (15:44 +0100)
committerDennis Tsiang <dennis.tsiang@arm.com>
Wed, 5 May 2021 14:44:32 +0000 (15:44 +0100)
commit241e05d3e4965509e0b329623814310282f2b615
tree3beee856b48a32034fab29852d8e1254e991cf42
parentf57f547a4ffb91650090608025e7632f16ec51ba
Resolve segfault in wsialloc_delete

A segfault can occur if wsialloc_delete is called but m_wsi_allocator's
ion field has not been allocated yet, as the function attempts to access
the ion properties.

This commit resolves the issue by changing m_wsi_allocator to an opaque
struct and removing the fd property, which was not being used.
wsialloc_new is then changed to return a pointer to the struct and
the swapchain then carries this pointer around, which will be
initialised to nullptr in the swapchain constructor.

Change-Id: I202e967cff4555babf0ddcd387275b74470b09d5
Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
util/wsialloc/wsialloc.h
util/wsialloc/wsialloc_ion.c
wsi/wayland/swapchain.cpp
wsi/wayland/swapchain.hpp