瀏覽代碼

I hate NULL pointer dereferences.

tags/v0.9.3
Michael Brown 18 年之前
父節點
當前提交
037da9d840
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4
    0
      src/net/netdevice.c

+ 4
- 0
src/net/netdevice.c 查看文件

@@ -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…
取消
儲存