Skip to content

Commit 7afb3e5

Browse files
claudiu-mdavem330
authored andcommitted
net: mscc: ocelot: don't handle netdev events for other netdevs
The check that the event is actually for this device should be moved from the "port" handler to the net device handler. Otherwise the port handler will deny bonding configuration for other net devices in the same system (like enetc in the LS1028A) that don't have the lag_upper_info->tx_type restriction that ocelot has. Fixes: dc96ee3 ("net: mscc: ocelot: add bonding support") Signed-off-by: Claudiu Manoil <claudiu.manoil@nxp.com> Signed-off-by: Vladimir Oltean <olteanv@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent cc59dbc commit 7afb3e5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/net/ethernet/mscc/ocelot.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1680,9 +1680,6 @@ static int ocelot_netdevice_port_event(struct net_device *dev,
16801680
struct ocelot_port *ocelot_port = netdev_priv(dev);
16811681
int err = 0;
16821682

1683-
if (!ocelot_netdevice_dev_check(dev))
1684-
return 0;
1685-
16861683
switch (event) {
16871684
case NETDEV_CHANGEUPPER:
16881685
if (netif_is_bridge_master(info->upper_dev)) {
@@ -1719,6 +1716,9 @@ static int ocelot_netdevice_event(struct notifier_block *unused,
17191716
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
17201717
int ret = 0;
17211718

1719+
if (!ocelot_netdevice_dev_check(dev))
1720+
return 0;
1721+
17221722
if (event == NETDEV_PRECHANGEUPPER &&
17231723
netif_is_lag_master(info->upper_dev)) {
17241724
struct netdev_lag_upper_info *lag_upper_info = info->upper_info;

0 commit comments

Comments
 (0)