dma-buf: dma_fence_put is NULL safe
authorChristian König <[email protected]>
Mon, 7 Aug 2017 21:32:21 +0000 (17:32 -0400)
committerAlex Deucher <[email protected]>
Wed, 9 Aug 2017 19:01:32 +0000 (15:01 -0400)
No need to check.

Acked-by: Sumit Semwal <[email protected]>
Signed-off-by: Christian König <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
drivers/dma-buf/reservation.c

index 393817e849ed2a662e8696867bb1297dad9c5397..87f8f57475007b836370f1c0b28172595d8d032c 100644 (file)
@@ -195,8 +195,7 @@ done:
        if (old)
                kfree_rcu(old, rcu);
 
-       if (old_fence)
-               dma_fence_put(old_fence);
+       dma_fence_put(old_fence);
 }
 
 /**
@@ -258,8 +257,7 @@ void reservation_object_add_excl_fence(struct reservation_object *obj,
                dma_fence_put(rcu_dereference_protected(old->shared[i],
                                                reservation_object_held(obj)));
 
-       if (old_fence)
-               dma_fence_put(old_fence);
+       dma_fence_put(old_fence);
 }
 EXPORT_SYMBOL(reservation_object_add_excl_fence);