netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch net] rocker: free netdevice during netdevice removal
@ 2015-08-02 17:29 Jiri Pirko
  2015-08-02 20:20 ` Scott Feldman
  2015-08-03  1:04 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Jiri Pirko @ 2015-08-02 17:29 UTC (permalink / raw)
  To: netdev; +Cc: davem, sfeldma, Ido Schimmel

From: Ido Schimmel <idosch@mellanox.com>

When removing a port's netdevice in 'rocker_remove_ports', we should
also free the allocated 'net_device' structure. Do that by calling
'free_netdev' after unregistering it.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Fixes: 4b8ac9660af ("rocker: introduce rocker switch driver")
---
 drivers/net/ethernet/rocker/rocker.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/rocker/rocker.c b/drivers/net/ethernet/rocker/rocker.c
index 7b4c347..1d0f140 100644
--- a/drivers/net/ethernet/rocker/rocker.c
+++ b/drivers/net/ethernet/rocker/rocker.c
@@ -4923,6 +4923,7 @@ static void rocker_remove_ports(const struct rocker *rocker)
 		rocker_port_ig_tbl(rocker_port, SWITCHDEV_TRANS_NONE,
 				   ROCKER_OP_FLAG_REMOVE);
 		unregister_netdev(rocker_port->dev);
+		free_netdev(rocker_port->dev);
 	}
 	kfree(rocker->ports);
 }
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [patch net] rocker: free netdevice during netdevice removal
  2015-08-02 17:29 [patch net] rocker: free netdevice during netdevice removal Jiri Pirko
@ 2015-08-02 20:20 ` Scott Feldman
  2015-08-03  1:04 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Scott Feldman @ 2015-08-02 20:20 UTC (permalink / raw)
  To: Jiri Pirko; +Cc: Netdev, David S. Miller, Ido Schimmel

On Sun, Aug 2, 2015 at 10:29 AM, Jiri Pirko <jiri@resnulli.us> wrote:
> From: Ido Schimmel <idosch@mellanox.com>
>
> When removing a port's netdevice in 'rocker_remove_ports', we should
> also free the allocated 'net_device' structure. Do that by calling
> 'free_netdev' after unregistering it.
>
> Signed-off-by: Ido Schimmel <idosch@mellanox.com>
> Signed-off-by: Jiri Pirko <jiri@resnulli.us>
> Fixes: 4b8ac9660af ("rocker: introduce rocker switch driver")

Acked-by: Scott Feldman <sfeldma@gmail.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch net] rocker: free netdevice during netdevice removal
  2015-08-02 17:29 [patch net] rocker: free netdevice during netdevice removal Jiri Pirko
  2015-08-02 20:20 ` Scott Feldman
@ 2015-08-03  1:04 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2015-08-03  1:04 UTC (permalink / raw)
  To: jiri; +Cc: netdev, sfeldma, idosch

From: Jiri Pirko <jiri@resnulli.us>
Date: Sun,  2 Aug 2015 19:29:16 +0200

> From: Ido Schimmel <idosch@mellanox.com>
> 
> When removing a port's netdevice in 'rocker_remove_ports', we should
> also free the allocated 'net_device' structure. Do that by calling
> 'free_netdev' after unregistering it.
> 
> Signed-off-by: Ido Schimmel <idosch@mellanox.com>
> Signed-off-by: Jiri Pirko <jiri@resnulli.us>
> Fixes: 4b8ac9660af ("rocker: introduce rocker switch driver")

Applied and queued up for -stable, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-08-03  1:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-02 17:29 [patch net] rocker: free netdevice during netdevice removal Jiri Pirko
2015-08-02 20:20 ` Scott Feldman
2015-08-03  1:04 ` David Miller

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).