winsys/amdgpu: avoid double simple_mtx_unlock()
authorJonathan Gray <jsg@jsg.id.au>
Thu, 28 Nov 2019 05:56:30 +0000 (16:56 +1100)
committerMarek Olšák <marek.olsak@amd.com>
Thu, 28 Nov 2019 20:03:59 +0000 (15:03 -0500)
pthread_mutex_unlock() when unlocked is documented by posix as
being undefined behaviour.  On OpenBSD pthread_mutex_unlock() will call
abort(3) if this happens.

This occurs in amdgpu_winsys_create() after
cb446dc0fa5c68f681108f4613560543aa4cf553
winsys/amdgpu: Add amdgpu_screen_winsys

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Cc: 19.2 19.3 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c

index 568d3852893976e4ac1beee2fc9471feb38039ba..2a341413033a2ecc07f76088c630d22422149388 100644 (file)
@@ -326,7 +326,6 @@ amdgpu_winsys_create(int fd, const struct pipe_screen_config *config,
    aws = util_hash_table_get(dev_tab, dev);
    if (aws) {
       pipe_reference(NULL, &aws->reference);
-      simple_mtx_unlock(&dev_tab_mutex);
 
       /* Release the device handle, because we don't need it anymore.
        * This function is returning an existing winsys instance, which