diff options
author | Emil Velikov <[email protected]> | 2020-03-05 13:05:36 +0000 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2020-04-01 16:24:19 +0100 |
commit | d3c91439713ecf025c7fe97aae3a4829b3f1250b (patch) | |
tree | 83f93d6db01f2a9bebc7085101d67379533b61f0 /src/egl | |
parent | fa5e800e05ab227786862383d3243e06c06d36d7 (diff) |
Revert "egl/dri2: Don't dlclose() the driver on dri2_load_driver_common failure"
This reverts commit 1b87f4058de84d7a0bb4ead0c4f4b024d4cce8fb.
dlclose() of the handle is perfectly reasonable, a follow-up NULL
assignment is missing.
As-is this causes a leak for nearly every platform, since they call
dri2_load_driver* initially, followed by a second swrast fallback call.
Some platforms even loop through the existing drivers probing.
Revert the commit and add the NULL check.
Fixes: 1b87f4058de ("egl/dri2: Don't dlclose() the driver on dri2_load_driver_common failure")
Signed-off-by: Emil Velikov <[email protected]>
Reviewed-by: Adam Jackson <[email protected]>
Reviewed-by: Eric Engestrom <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4084>
Diffstat (limited to 'src/egl')
-rw-r--r-- | src/egl/drivers/dri2/egl_dri2.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index 0e065acd763..cdaf3a75029 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -822,9 +822,11 @@ dri2_load_driver_common(_EGLDisplay *disp, if (!extensions) return EGL_FALSE; - if (!dri2_bind_extensions(dri2_dpy, driver_extensions, extensions, false)) + if (!dri2_bind_extensions(dri2_dpy, driver_extensions, extensions, false)) { + dlclose(dri2_dpy->driver); + dri2_dpy->driver = NULL; return EGL_FALSE; - + } dri2_dpy->driver_extensions = extensions; dri2_bind_extensions(dri2_dpy, optional_driver_extensions, extensions, true); |