d3d12: Don't crash when libd3d12.so can't be found

`d3d12_destroy_screen` is called by `d3d12_create_dxcore_screen` after
`d3d12_init_screen_base` fails and attempts to call `util_dl_close` on
a NULL pointer, leading to an abort.

To fix this, only close the library after if it was actually opened.

Cc: mesa-stable
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20145>
This commit is contained in:
Jan Alexander Steffens (heftig)
2022-12-04 00:17:57 +00:00
parent 55ffbf867b
commit b3d1ae19f2
+2 -1
View File
@@ -743,7 +743,8 @@ d3d12_destroy_screen(struct d3d12_screen *screen)
slab_destroy_parent(&screen->transfer_pool);
mtx_destroy(&screen->submit_mutex);
mtx_destroy(&screen->descriptor_pool_mutex);
util_dl_close(screen->d3d12_mod);
if (screen->d3d12_mod)
util_dl_close(screen->d3d12_mod);
glsl_type_singleton_decref();
FREE(screen);
}