Skip to contentSkip to conversation

net: sparx5: mdb add/del handle non-sparx5 devices

PATCH Applied Casper Andersson 3 participants 3 messages Jun 30, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: sparx5: mdb add/del handle non-sparx5 devices

When adding/deleting mdb entries on other net_devices, eg., tap interfaces, it should not crash.

Fixes 3bacfccdcb2d
---
 drivers/net/ethernet/microchip/sparx5/sparx5_switchdev.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/net/ethernet/microchip/sparx5/sparx5_switchdev.c +6 -0
index 3429660cd2e5..5edc8b7176c8 100644
@@ -396,6 +396,9 @@ static int sparx5_handle_port_mdb_add(struct net_device *dev,
 	u32 mact_entry;
 	int res, err;
 
+	if (!sparx5_netdevice_check(dev))
+		return -EOPNOTSUPP;
+
 	if (netif_is_bridge_master(v->obj.orig_dev)) {
 		sparx5_mact_learn(spx5, PGID_CPU, v->addr, v->vid);
 		return 0;
@@ -466,6 +469,9 @@ static int sparx5_handle_port_mdb_del(struct net_device *dev,
 	u32 mact_entry, res, pgid_entry[3];
 	int err;
 
+	if (!sparx5_netdevice_check(dev))
+		return -EOPNOTSUPP;
+
 	if (netif_is_bridge_master(v->obj.orig_dev)) {
 		sparx5_mact_forget(spx5, v->addr, v->vid);
 		return 0;
Signature · 1 line
2.30.2
maintainer
#1 lore raw
Quoted 1 line · On Thu, 30 Jun 2022 14:22:26 +0200 Casper Andersson wrote:
Fixes 3bacfccdcb2d

Please note the correct format includes the title, so:

Fixes 3bacfccdcb2d ("net: sparx5: Add mdb handlers")

Also you should have kept the review tags you already received.

I'll fix when applying, thanks.

#2 lore raw
In reply to Casper Andersson
This patch was applied to netdev/net.git (master) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Thu, 30 Jun 2022 14:22:26 +0200 you wrote:

When adding/deleting mdb entries on other net_devices, eg., tap interfaces, it should not crash.

Fixes 3bacfccdcb2d

[...]

Here is the summary with links:
- [net] net: sparx5: mdb add/del handle non-sparx5 devices

    https://git.kernel.org/netdev/net/c/9c5de246c1db

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html