[PATCH 4/4] dma-buf: Use rcu_assign_pointer() to set rcu protected pointers

Ville Syrjala ville.syrjala at linux.intel.com
Thu Nov 2 20:03:36 UTC 2017


From: Ville Syrjälä <ville.syrjala at linux.intel.com>

Use rcu_assign_pointer() when setting an rcu protected pointer.
This gets rid of another sparse warning.

Cc: Dave Airlie <airlied at redhat.com>
Cc: Jason Ekstrand <jason at jlekstrand.net>
Cc: linaro-mm-sig at lists.linaro.org
Cc: linux-media at vger.kernel.org
Cc: Alex Deucher <alexander.deucher at amd.com>
Cc: Christian König <christian.koenig at amd.com>
Cc: Sumit Semwal <sumit.semwal at linaro.org>
Cc: Chris Wilson <chris at chris-wilson.co.uk>
Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
 drivers/dma-buf/reservation.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma-buf/reservation.c b/drivers/dma-buf/reservation.c
index b44d9d7db347..d90333e0b6d5 100644
--- a/drivers/dma-buf/reservation.c
+++ b/drivers/dma-buf/reservation.c
@@ -318,7 +318,7 @@ int reservation_object_copy_fences(struct reservation_object *dst,
 				continue;
 			}
 
-			dst_list->shared[dst_list->shared_count++] = fence;
+			rcu_assign_pointer(dst_list->shared[dst_list->shared_count++], fence);
 		}
 	} else {
 		dst_list = NULL;
-- 
2.13.6



More information about the dri-devel mailing list