diff mbox series

[net-next] net: ocelot: Fix deletetion of MRP entries from MAC table

Message ID 20210318192938.504549-1-horatiu.vultur@microchip.com (mailing list archive)
State Accepted
Commit d25fde64d1c271277b801c57a954037f80babbd1
Delegated to: Netdev Maintainers
Headers show
Series [net-next] net: ocelot: Fix deletetion of MRP entries from MAC table | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net-next
netdev/subject_prefix success Link
netdev/cc_maintainers success CCed 8 of 8 maintainers
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 16 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success Link

Commit Message

Horatiu Vultur March 18, 2021, 7:29 p.m. UTC
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>
---
 drivers/net/ethernet/mscc/ocelot_mrp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org March 19, 2021, 2:20 a.m. UTC | #1
Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Thu, 18 Mar 2021 20:29:38 +0100 you wrote:
> 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.
> 
> [...]

Here is the summary with links:
  - [net-next] net: ocelot: Fix deletetion of MRP entries from MAC table
    https://git.kernel.org/netdev/net-next/c/d25fde64d1c2

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
diff mbox series

Patch

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;
 }