From: David Daney <ddaney@caviumnetworks.com>
To: Vasiliy Kulikov <segooon@gmail.com>
Cc: kernel-janitors@vger.kernel.org,
Greg Kroah-Hartman <gregkh@suse.de>,
Ralf Baechle <ralf@linux-mips.org>,
Andy Shevchenko <andy.shevchenko@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 6/9] staging: octeon: use free_netdev(netdev) instead of kfree()
Date: Mon, 27 Sep 2010 11:08:38 -0700 [thread overview]
Message-ID: <4CA0DDA6.7040600@caviumnetworks.com> (raw)
In-Reply-To: <1285495102-22111-1-git-send-email-segooon@gmail.com>
On 09/26/2010 02:58 AM, Vasiliy Kulikov wrote:
> 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.
>
There is no Signed-off-by header here.
Please resend the patch with the proper headers.
Other than that, it looks good to me. You can add:
Acked-by: David Daney <ddaney@caviumnetworks.com>
Thanks.
> ---
> drivers/staging/octeon/ethernet.c | 8 ++++----
> 1 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/staging/octeon/ethernet.c b/drivers/staging/octeon/ethernet.c
> index fb568a9..a8f780e 100644
> --- a/drivers/staging/octeon/ethernet.c
> +++ b/drivers/staging/octeon/ethernet.c
> @@ -670,7 +670,7 @@ static int __init cvm_oct_init_module(void)
>
> if (register_netdev(dev)< 0) {
> pr_err("Failed to register ethernet device for POW\n");
> - kfree(dev);
> + free_netdev(dev);
> } else {
> cvm_oct_device[CVMX_PIP_NUM_INPUT_PORTS] = dev;
> pr_info("%s: POW send group %d, receive group %d\n",
> @@ -756,12 +756,12 @@ static int __init cvm_oct_init_module(void)
> }
>
> if (!dev->netdev_ops) {
> - kfree(dev);
> + free_netdev(dev);
> } else if (register_netdev(dev)< 0) {
> pr_err("Failed to register ethernet device "
> "for interface %d, port %d\n",
> interface, priv->port);
> - kfree(dev);
> + free_netdev(dev);
> } else {
> cvm_oct_device[priv->port] = dev;
> fau -=
> @@ -815,7 +815,7 @@ static void __exit cvm_oct_cleanup_module(void)
>
> cvm_oct_tx_shutdown_dev(dev);
> unregister_netdev(dev);
> - kfree(dev);
> + free_netdev(dev);
> cvm_oct_device[port] = NULL;
> }
> }
next prev parent reply other threads:[~2010-09-27 18:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-26 9:58 [PATCH 6/9] staging: octeon: use free_netdev(netdev) instead of kfree() Vasiliy Kulikov
2010-09-27 18:08 ` David Daney [this message]
2010-09-28 17:08 Vasiliy Kulikov
2010-09-28 17:13 ` David Daney
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=4CA0DDA6.7040600@caviumnetworks.com \
--to=ddaney@caviumnetworks.com \
--cc=andy.shevchenko@gmail.com \
--cc=davem@davemloft.net \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@suse.de \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ralf@linux-mips.org \
--cc=segooon@gmail.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).