OSDN Git Service

dma-fence: fix dma_fence_get_rcu_safe v2
authorChristian König <christian.koenig@amd.com>
Fri, 15 Sep 2017 09:53:07 +0000 (11:53 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 9 Oct 2017 15:14:05 +0000 (11:14 -0400)
commitf8e0731db4a02c8c5624e1dce6dc983210a51f64
tree0744c2447a9c5f68e3953b8b1bd90abedc65bfdf
parent39e16ba16c147e662bf9fbcee9a99d70d420382f
dma-fence: fix dma_fence_get_rcu_safe v2

When dma_fence_get_rcu() fails to acquire a reference it doesn't necessary
mean that there is no fence at all.

It usually mean that the fence was replaced by a new one and in this situation
we certainly want to have the new one as result and *NOT* NULL.

v2: Keep extra check after dma_fence_get_rcu().

Signed-off-by: Christian König <christian.koenig@amd.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: linux-media@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: linaro-mm-sig@lists.linaro.org
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1505469187-3565-1-git-send-email-deathsimple@vodafone.de
include/linux/dma-fence.h