vulkan/wsi: check if image info was already freed
authorAlejandro Piñeiro <apinheiro@igalia.com>
Fri, 13 Jan 2023 12:42:26 +0000 (13:42 +0100)
committerEric Engestrom <eric@engestrom.ch>
Thu, 26 Jan 2023 15:40:30 +0000 (15:40 +0000)
commit116b1de2aaebf046df449b198bbc22d0959863af
treefa5902976abeeb459d1ece4f2d31f18688f94f70
parent893910b3535f4fd51267c39514cc78622ebd91a6
vulkan/wsi: check if image info was already freed

We set the different data being freed to NULL after freeing it, and
checks for NULL before freeing it.

This fixes several double free crash with v3dv, when running OOM wsi
tests, like for example:
dEQP-VK.wsi.xlib.swapchain.simulate_oom.composite_alpha

Although note that only one person got those on a new fresh install of
the Raspbian OS, so this problem was rare.

Fixes: 5b13d74583513ddd029e ("vulkan/wsi/drm: Break create_native_image in pieces")
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20695>
(cherry picked from commit b27e42dcb5f995ef0b7f8d07d5868eed60896b59)
.pick_status.json
src/vulkan/wsi/wsi_common.c