mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 01:49:46 +00:00
rocker: free netdevice during netdevice removal
[ Upstream commit1ebd47efa4] 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:4b8ac9660a("rocker: introduce rocker switch driver") Acked-by: Scott Feldman <sfeldma@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
563071d689
commit
715bb7ae43
@@ -4587,6 +4587,7 @@ static void rocker_remove_ports(struct rocker *rocker)
|
||||
rocker_port = rocker->ports[i];
|
||||
rocker_port_ig_tbl(rocker_port, ROCKER_OP_FLAG_REMOVE);
|
||||
unregister_netdev(rocker_port->dev);
|
||||
free_netdev(rocker_port->dev);
|
||||
}
|
||||
kfree(rocker->ports);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user