Revert "egl/dri2: Don't dlclose() the driver on dri2_load_driver_common failure"
authorEmil Velikov <emil.velikov@collabora.com>
Thu, 5 Mar 2020 13:05:36 +0000 (13:05 +0000)
committerEmil Velikov <emil.l.velikov@gmail.com>
Wed, 1 Apr 2020 15:24:19 +0000 (16:24 +0100)
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 <emil.velikov@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4084>


No differences found