⬢ DragonFlyBSD Kernel Audit
DF-4796 / fix.diff
← back to finding ↓ download raw
--- a/sys/dev/drm/linux_reservation.c
+++ b/sys/dev/drm/linux_reservation.c
@@ -370,6 +370,14 @@
 						   GFP_KERNEL);
 				if (nshared) {
 					shared = nshared;
+					/*
+					 * The exclusive fence was acquired
+					 * at the top of this iteration and
+					 * the next iteration acquires it
+					 * again; drop this reference or it
+					 * leaks.  (DF-4796)
+					 */
+					dma_fence_put(fence_excl);
 					continue;
 				}