From: Amir Noam <amir.noam@intel.com>
To: bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com
Cc: jgarzik@pobox.com
Subject: [PATCH 2/3] [bonding 2.4] Backport free_netdev()
Date: Mon, 15 Sep 2003 12:00:34 +0300 [thread overview]
Message-ID: <200309151200.34709.amir.noam@intel.com> (raw)
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__ */
reply other threads:[~2003-09-15 9:00 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200309151200.34709.amir.noam@intel.com \
--to=amir.noam@intel.com \
--cc=bonding-devel@lists.sourceforge.net \
--cc=jgarzik@pobox.com \
--cc=netdev@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).