diff options
author | Jan Alexander Steffens (heftig) <heftig@archlinux.org> | 2022-12-04 00:17:57 +0000 |
---|---|---|
committer | Eric Engestrom <eric@engestrom.ch> | 2022-12-14 20:47:00 +0000 |
commit | 1b27820b769087c1ff42ddd505a19be18b182e92 (patch) | |
tree | 73e5722aa474f0a34a2d73113443fe947cf9b24b | |
parent | d43425f7e099a2267e4341a56aa4fb185924190c (diff) | |
download | mesa-1b27820b769087c1ff42ddd505a19be18b182e92.tar.gz |
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>
(cherry picked from commit b3d1ae19f2f4d93cf0a5f45a598149ac4e8e05aa)
-rw-r--r-- | .pick_status.json | 2 | ||||
-rw-r--r-- | src/gallium/drivers/d3d12/d3d12_screen.cpp | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/.pick_status.json b/.pick_status.json index fa6bed05f7a..c28142a42a2 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -4018,7 +4018,7 @@ "description": "d3d12: Don't crash when libd3d12.so can't be found", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/gallium/drivers/d3d12/d3d12_screen.cpp b/src/gallium/drivers/d3d12/d3d12_screen.cpp index 1cbe1fbdd5e..c21c60e4a29 100644 --- a/src/gallium/drivers/d3d12/d3d12_screen.cpp +++ b/src/gallium/drivers/d3d12/d3d12_screen.cpp @@ -741,7 +741,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); } |