dma-buf: Use dma_fence_unwrap_for_each when importing fences
authorJason Ekstrand <jason@jlekstrand.net>
Tue, 2 Aug 2022 21:01:58 +0000 (16:01 -0500)
committerChristian König <christian.koenig@amd.com>
Fri, 18 Nov 2022 19:07:58 +0000 (20:07 +0100)
commitc19083c72ea72a1c12037bb3d708014632df80e4
treeb285cb8a9867070080c5ca4f66a92b2a8ed7f95e
parentb09d6acba1d9a23963fedf96b4191502a4fec25d
dma-buf: Use dma_fence_unwrap_for_each when importing fences

Ever since 68129f431faa ("dma-buf: warn about containers in dma_resv object"),
dma_resv_add_shared_fence will warn if you attempt to add a container fence.
While most drivers were fine, fences can also be added to a dma_resv via the
recently added DMA_BUF_IOCTL_IMPORT_SYNC_FILE.  Use dma_fence_unwrap_for_each
to add each fence one at a time.

Fixes: 594740497e99 ("dma-buf: Add an API for importing sync files (v10)")
Signed-off-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reported-by: Sarah Walker <Sarah.Walker@imgtec.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
CC: stable@vger.kernel.org
Link: https://patchwork.freedesktop.org/patch/msgid/20220802210158.4162525-1-jason.ekstrand@collabora.com
Signed-off-by: Christian König <christian.koenig@amd.com>
drivers/dma-buf/dma-buf.c