Skip to content

Commit

Permalink
net: ocelot: Fix deletetion of MRP entries from MAC table
Browse files Browse the repository at this point in the history
When a MRP ring was deleted or disabled, the driver was iterating over
the ports to detect if any other MPR rings exists and in case it didn't
exist it would delete the MAC table entry. But the problem was that it
used the last iterated port to delete the MAC table entry and this could
be a NULL port.

The fix consists of using the port on which the function was called.

Fixes: 7c588c3 ("net: ocelot: Extend MRP")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Horatiu Vultur authored and David S. Miller committed Mar 19, 2021
1 parent 536e100 commit d25fde6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ethernet/mscc/ocelot_mrp.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ int ocelot_mrp_del(struct ocelot *ocelot, int port,
goto out;
}

ocelot_mrp_del_mac(ocelot, ocelot_port);
ocelot_mrp_del_mac(ocelot, ocelot->ports[port]);
out:
return 0;
}
Expand Down Expand Up @@ -251,7 +251,7 @@ int ocelot_mrp_del_ring_role(struct ocelot *ocelot, int port,
goto out;
}

ocelot_mrp_del_mac(ocelot, ocelot_port);
ocelot_mrp_del_mac(ocelot, ocelot->ports[port]);
out:
return 0;
}
Expand Down

0 comments on commit d25fde6

Please sign in to comment.