patch-2.1.73 linux/net/ipv6/addrconf.c

Next file: linux/net/sunrpc/svc.c
Previous file: linux/net/ipv4/udp.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.72/linux/net/ipv6/addrconf.c linux/net/ipv6/addrconf.c
@@ -5,7 +5,7 @@
  *	Authors:
  *	Pedro Roque		<roque@di.fc.ul.pt>	
  *
- *	$Id: addrconf.c,v 1.28 1997/11/05 20:20:43 kuznet Exp $
+ *	$Id: addrconf.c,v 1.30 1997/12/09 17:12:47 freitag Exp $
  *
  *	This program is free software; you can redistribute it and/or
  *      modify it under the terms of the GNU General Public License
@@ -18,6 +18,8 @@
  *
  *	Janos Farkas			:	delete timer on ifdown
  *	<chexum@bankinf.banki.hu>
+ *	Andi Kleen			:	kill doube kfree on module
+ *						unload.
  */
 
 #include <linux/config.h>
@@ -1045,7 +1047,6 @@
 	return NOTIFY_OK;
 }
 
-
 static int addrconf_ifdown(struct device *dev)
 {
 	struct inet6_dev *idev, **bidev;
@@ -1067,6 +1068,8 @@
 
 	if (idev == NULL) {
 		end_bh_atomic();
+
+		printk(KERN_DEBUG "addrconf_ifdown: invalid device %p\n",dev);
 		return -ENODEV;
 	}
 
@@ -1403,13 +1406,10 @@
 	 */
 
 	for (i=0; i < IN6_ADDR_HSIZE; i++) {
-		for (idev = inet6_dev_lst[i]; idev; ) {
-			struct inet6_dev *back;
-
+		struct inet6_dev *next;
+		for (idev = inet6_dev_lst[i]; idev; idev = next) {
+			next = idev->next;
 			addrconf_ifdown(idev->dev);	
-			back = idev;
-			idev = idev->next;
-			kfree(back);
 		}
 	}
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov