diff options
author | Vasiliy Kulikov <segooon@gmail.com> | 2010-09-28 21:08:01 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-09-30 04:14:20 -0700 |
commit | c4711c3acb9fbe7f559ead7ff511dba3665a048e (patch) | |
tree | 822a393b751aadaec89e1b0dc07b3c3db1ea64e1 /drivers/staging/octeon | |
parent | 8db3271cb24d4298e39a249c4dd966b189b05e97 (diff) | |
download | linux-c4711c3acb9fbe7f559ead7ff511dba3665a048e.tar.gz linux-c4711c3acb9fbe7f559ead7ff511dba3665a048e.tar.bz2 linux-c4711c3acb9fbe7f559ead7ff511dba3665a048e.zip |
staging: octeon: use free_netdev(netdev) instead of kfree()
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.
Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
Acked-by: David Daney <ddaney@caviumnetworks.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/octeon')
-rw-r--r-- | 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 fb568a935eef..a8f780e95e0a 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; } } |