* [PATCH 2/3] [bonding 2.4] Backport free_netdev()
@ 2003-09-15 9:00 Amir Noam
0 siblings, 0 replies; only message in thread
From: Amir Noam @ 2003-09-15 9:00 UTC (permalink / raw)
To: bonding-devel, netdev; +Cc: jgarzik
diff -Nuarp a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
--- a/drivers/net/bonding/bond_main.c 2003-09-15 11:39:39.000000000 +0300
+++ b/drivers/net/bonding/bond_main.c 2003-09-15 11:39:41.000000000 +0300
@@ -3788,7 +3788,7 @@ static void bond_free_all(void)
unregister_netdev(dev);
bond_deinit(dev);
- kfree(dev);
+ free_netdev(dev);
}
}
@@ -4194,7 +4194,7 @@ static int __init bonding_init(void)
err = dev_alloc_name(dev, "bond%d");
if (err < 0) {
- kfree(dev);
+ free_netdev(dev);
goto out_err;
}
@@ -4204,7 +4204,7 @@ static int __init bonding_init(void)
*/
err = bond_init(dev);
if (err < 0) {
- kfree(dev);
+ free_netdev(dev);
goto out_err;
}
@@ -4213,7 +4213,7 @@ static int __init bonding_init(void)
err = register_netdevice(dev);
if (err < 0) {
bond_deinit(dev);
- kfree(dev);
+ free_netdev(dev);
goto out_err;
}
}
diff -Nuarp a/include/linux/netdevice.h b/include/linux/netdevice.h
--- a/include/linux/netdevice.h 2003-09-15 11:39:39.000000000 +0300
+++ b/include/linux/netdevice.h 2003-09-15 11:39:41.000000000 +0300
@@ -49,6 +49,7 @@ struct ethtool_ops;
#define HAVE_ALLOC_NETDEV /* feature macro: alloc_xxxdev
functions are available. */
+#define HAVE_FREE_NETDEV
#define NET_XMIT_SUCCESS 0
#define NET_XMIT_DROP 1 /* skb dropped */
@@ -871,6 +872,10 @@ extern int netdev_fastroute_obstacles;
extern void dev_clear_fastroute(struct net_device *dev);
#endif
+static inline void free_netdev(struct net_device *dev)
+{
+ kfree(dev);
+}
#endif /* __KERNEL__ */
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2003-09-15 9:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-15 9:00 [PATCH 2/3] [bonding 2.4] Backport free_netdev() Amir Noam
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).