Commit 1ebd47ef authored by Ido Schimmel's avatar Ido Schimmel Committed by David S. Miller

rocker: free netdevice during netdevice removal

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: default avatarIdo Schimmel <idosch@mellanox.com>
Signed-off-by: default avatarJiri Pirko <jiri@resnulli.us>
Fixes: 4b8ac966 ("rocker: introduce rocker switch driver")
Acked-by: default avatarScott Feldman <sfeldma@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7c764cec
...@@ -4821,6 +4821,7 @@ static void rocker_remove_ports(const struct rocker *rocker) ...@@ -4821,6 +4821,7 @@ static void rocker_remove_ports(const struct rocker *rocker)
rocker_port_ig_tbl(rocker_port, SWITCHDEV_TRANS_NONE, rocker_port_ig_tbl(rocker_port, SWITCHDEV_TRANS_NONE,
ROCKER_OP_FLAG_REMOVE); ROCKER_OP_FLAG_REMOVE);
unregister_netdev(rocker_port->dev); unregister_netdev(rocker_port->dev);
free_netdev(rocker_port->dev);
} }
kfree(rocker->ports); kfree(rocker->ports);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment