diff options
author | Horatiu Vultur <horatiu.vultur@microchip.com> | 2021-03-18 20:29:38 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-03-18 19:13:42 -0700 |
commit | d25fde64d1c271277b801c57a954037f80babbd1 (patch) | |
tree | 1965afedbe12717a4b370d06144ba3cf28b69d04 | |
parent | 536e1004d273cf55d0e6c6ab6bfe74dc60464cd2 (diff) | |
download | linux-d25fde64d1c271277b801c57a954037f80babbd1.tar.gz linux-d25fde64d1c271277b801c57a954037f80babbd1.tar.bz2 linux-d25fde64d1c271277b801c57a954037f80babbd1.zip |
net: ocelot: Fix deletetion of MRP entries from MAC table
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: 7c588c3e96e9733a ("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>
-rw-r--r-- | drivers/net/ethernet/mscc/ocelot_mrp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/mscc/ocelot_mrp.c b/drivers/net/ethernet/mscc/ocelot_mrp.c index 439129a65b71..c3cbcaf64bb2 100644 --- a/drivers/net/ethernet/mscc/ocelot_mrp.c +++ b/drivers/net/ethernet/mscc/ocelot_mrp.c @@ -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; } @@ -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; } |