Skip to content

Commit 9f8f350

Browse files
committed
Merge branch 'Bonding-fixes-for-Ocelot-switch'
Vladimir Oltean says: ==================== Bonding fixes for Ocelot switch This series fixes 2 issues with bonding in a system that integrates the ocelot driver, but the ports that are bonded do not actually belong to ocelot. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents cc59dbc + 3b3eed8 commit 9f8f350

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

drivers/net/ethernet/mscc/ocelot.c

Lines changed: 5 additions & 4 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,12 +1716,16 @@ 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;
17251725
struct netlink_ext_ack *extack;
17261726

1727-
if (lag_upper_info->tx_type != NETDEV_LAG_TX_TYPE_HASH) {
1727+
if (lag_upper_info &&
1728+
lag_upper_info->tx_type != NETDEV_LAG_TX_TYPE_HASH) {
17281729
extack = netdev_notifier_info_to_extack(&info->info);
17291730
NL_SET_ERR_MSG_MOD(extack, "LAG device using unsupported Tx type");
17301731

0 commit comments

Comments
 (0)