From: Vasiliy Kulikov <segooon@gmail.com>
To: kernel-janitors@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@suse.de>,
Vipin Mehta <vmehta@atheros.com>,
Andy Shevchenko <andy.shevchenko@gmail.com>,
Joe Perches <joe@perches.com>,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: [PATCH 5/9] staging: ath6kl: use free_netdev(netdev) instead of kfree()
Date: Sun, 26 Sep 2010 13:58:18 +0400 [thread overview]
Message-ID: <1285495099-22069-1-git-send-email-segooon@gmail.com> (raw)
It is not guaranteed that free_netdev() is macro.
Freeing netdev without free_netdev() leads to net, tx leaks.
I might lead to dereferencing freed pointer.
---
drivers/staging/ath6kl/os/linux/ar6000_drv.c | 8 --------
1 files changed, 0 insertions(+), 8 deletions(-)
diff --git a/drivers/staging/ath6kl/os/linux/ar6000_drv.c b/drivers/staging/ath6kl/os/linux/ar6000_drv.c
index daba6e4..c5a6d6c 100644
--- a/drivers/staging/ath6kl/os/linux/ar6000_drv.c
+++ b/drivers/staging/ath6kl/os/linux/ar6000_drv.c
@@ -2143,11 +2143,7 @@ ar6000_destroy(struct net_device *dev, unsigned int unregister)
unregister_netdev(dev);
is_netdev_registered = 0;
}
-#ifndef free_netdev
- kfree(dev);
-#else
free_netdev(dev);
-#endif
#ifdef ATH6K_CONFIG_CFG80211
ar6k_cfg80211_deinit(ar);
@@ -6429,11 +6425,7 @@ A_STATUS ar6000_remove_ap_interface(AR_SOFTC_T *ar)
ar6000_stop_ap_interface(ar);
unregister_netdev(arApNetDev);
-#ifndef free_netdev
- kfree(arApNetDev);
-#else
free_netdev(apApNetDev);
-#endif
A_PRINTF("Remove AP interface\n");
}
--
1.7.0.4
next reply other threads:[~2010-09-26 9:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-26 9:58 Vasiliy Kulikov [this message]
2010-09-28 17:07 [PATCH 5/9] staging: ath6kl: use free_netdev(netdev) instead of kfree() Vasiliy Kulikov
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=1285495099-22069-1-git-send-email-segooon@gmail.com \
--to=segooon@gmail.com \
--cc=andy.shevchenko@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@suse.de \
--cc=joe@perches.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=vmehta@atheros.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).