winsys/amdgpu: fix a device handle leak in amdgpu_winsys_create

Cc: 18.2 18.3 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
This commit is contained in:
Marek Olšák 2018-11-19 18:17:40 -05:00
parent 82aa07f81f
commit d4e7d8b7f0
1 changed files with 6 additions and 0 deletions

View File

@ -280,6 +280,12 @@ amdgpu_winsys_create(int fd, const struct pipe_screen_config *config,
if (ws) {
pipe_reference(NULL, &ws->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
* has its own device handle.
*/
amdgpu_device_deinitialize(dev);
return &ws->base;
}