Skip to content

Commit

Permalink
rocker: gaurd against NULL rocker_port when removing ports
Browse files Browse the repository at this point in the history
The ports array is filled in as ports are probed, but if probing doesn't
finish, we need to stop only those ports that where probed successfully.
Check the ports array for NULL to skip un-probed ports when stopping.

Signed-off-by: Scott Feldman <[email protected]>
Acked-by: Jiri Pirko <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
scottfeldman authored and davem330 committed Jun 15, 2015
1 parent 9464ca6 commit a072031
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/ethernet/rocker/rocker.c
Original file line number Diff line number Diff line change
Expand Up @@ -4802,6 +4802,8 @@ static void rocker_remove_ports(const struct rocker *rocker)

for (i = 0; i < rocker->port_count; i++) {
rocker_port = rocker->ports[i];
if (!rocker_port)
continue;
rocker_port_ig_tbl(rocker_port, SWITCHDEV_TRANS_NONE,
ROCKER_OP_FLAG_REMOVE);
unregister_netdev(rocker_port->dev);
Expand Down

0 comments on commit a072031

Please sign in to comment.