⬢ DragonFlyBSD Kernel Audit
DF-3513 / fix.diff
← back to finding ↓ download raw
--- a/sys/netgraph7/bluetooth/include/ng_bluetooth.h
+++ b/sys/netgraph7/bluetooth/include/ng_bluetooth.h
@@ -208,7 +208,13 @@
 			if (i == NULL) 			\
 				break; 			\
 							\
+			/* NG_FREE_ITEM() is flag-only in netgraph7;\
+			 * the queue holds a real reference\
+			 * (ng_ref_item at enqueue) to drop here.\
+			 * Needs <sys/refcount.h> + netgraph2.h.\
+			 */\
 			NG_FREE_ITEM(i); 		\
+			ng_unref_item(i, 0);			\
 		} 					\
 	} while (0)
 
--- a/sys/netgraph7/bluetooth/hci/ng_hci_misc.c
+++ b/sys/netgraph7/bluetooth/hci/ng_hci_misc.c
@@ -37,8 +37,10 @@
 #include <sys/malloc.h>
 #include <sys/mbuf.h>
 #include <sys/queue.h>
+#include <sys/refcount.h>
 #include <netgraph7/ng_message.h>
 #include <netgraph7/netgraph.h>
+#include <netgraph7/netgraph2.h>
 #include <netgraph7/bluetooth/include/ng_bluetooth.h>
 #include <netgraph7/bluetooth/include/ng_hci.h>
 #include <netgraph7/bluetooth/hci/ng_hci_var.h>