dma-fence: Clear fence->status during dma_fence_init()
authorChris Wilson <chris@chris-wilson.co.uk>
Wed, 4 Jan 2017 14:12:20 +0000 (14:12 +0000)
committerSumit Semwal <sumit.semwal@linaro.org>
Mon, 9 Jan 2017 14:35:31 +0000 (20:05 +0530)
As the fence->status is an optional field that may be set before
dma_fence_signal() is called to convey that the fence completed with an
error, we have to ensure that it is always set to zero on initialisation
so that the typical use (i.e. unset) always flags a successful completion.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Sumit Semwal <sumit.semwal@linaro.org>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Link: http://patchwork.freedesktop.org/patch/msgid/20170104141222.6992-1-chris@chris-wilson.co.uk
drivers/dma-buf/dma-fence.c

index 0212af7997d9fa2177b39d05b675ad047743f35f..cb6eef308cd9326152843c138b77975070a5908c 100644 (file)
@@ -541,6 +541,7 @@ dma_fence_init(struct dma_fence *fence, const struct dma_fence_ops *ops,
        fence->context = context;
        fence->seqno = seqno;
        fence->flags = 0UL;
+       fence->status = 0;
 
        trace_dma_fence_init(fence);
 }