Browse Source

I hate NULL pointer dereferences.

tags/v0.9.3
Michael Brown 18 years ago
parent
commit
037da9d840
1 changed files with 4 additions and 0 deletions
  1. 4
    0
      src/net/netdevice.c

+ 4
- 0
src/net/netdevice.c View File

@@ -91,6 +91,10 @@ int netdev_tx ( struct net_device *netdev, struct pk_buff *pkb ) {
91 91
 void netdev_tx_complete ( struct net_device *netdev, struct pk_buff *pkb ) {
92 92
 	DBGC ( netdev, "NETDEV %p transmission %p complete\n", netdev, pkb );
93 93
 
94
+	/* Catch data corruption as early as possible */
95
+	assert ( pkb->list.next != NULL );
96
+	assert ( pkb->list.prev != NULL );
97
+
94 98
 	list_del ( &pkb->list );
95 99
 	free_pkb ( pkb );
96 100
 }

Loading…
Cancel
Save