⬢ DragonFlyBSD Kernel Audit
DF-4772 / fix.diff
← back to finding ↓ download raw
--- a/sys/dev/drm/linux_reservation.c
+++ b/sys/dev/drm/linux_reservation.c
@@ -407,6 +407,9 @@ int reservation_object_get_fences_rcu(struct reservation_object *obj,
 	if (pshared)
 		*pshared = shared;
 	if (pfence_excl)
 		*pfence_excl = fence_excl;
+	else if (fence_excl)
+		/* caller does not want the exclusive fence: drop our ref */
+		dma_fence_put(fence_excl);
 
 	return ret;
 }