From: Sil Vilerino Date: Wed, 22 Nov 2023 03:06:08 +0000 (-0500) Subject: d3d12: d3d12_create_fence_win32 - Fix double refcount bump X-Git-Tag: upstream/23.3.3~129 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=85a215801cf8dc87587614fed7c49a846a923071;p=platform%2Fupstream%2Fmesa.git d3d12: d3d12_create_fence_win32 - Fix double refcount bump Reviewed-by: Jesse Natalie Cc: mesa-stable Part-of: (cherry picked from commit d0103648410f75c1dae48283759d884e9fbf1190) --- diff --git a/.pick_status.json b/.pick_status.json index ce9fcb9..e5bb7c2 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -2514,7 +2514,7 @@ "description": "d3d12: d3d12_create_fence_win32 - Fix double refcount bump", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/gallium/drivers/d3d12/d3d12_screen.cpp b/src/gallium/drivers/d3d12/d3d12_screen.cpp index 192d4d9..ee74cf2 100644 --- a/src/gallium/drivers/d3d12/d3d12_screen.cpp +++ b/src/gallium/drivers/d3d12/d3d12_screen.cpp @@ -1189,10 +1189,9 @@ d3d12_get_node_mask(struct pipe_screen *pscreen) static void d3d12_create_fence_win32(struct pipe_screen *pscreen, struct pipe_fence_handle **pfence, void *handle, const void *name, enum pipe_fd_type type) { - d3d12_fence_reference((struct d3d12_fence **)pfence, - type == PIPE_FD_TYPE_TIMELINE_SEMAPHORE ? - d3d12_open_fence(d3d12_screen(pscreen), handle, name) : - nullptr); + d3d12_fence_reference((struct d3d12_fence **)pfence, nullptr); + if(type == PIPE_FD_TYPE_TIMELINE_SEMAPHORE) + *pfence = (struct pipe_fence_handle*) d3d12_open_fence(d3d12_screen(pscreen), handle, name); } static void