Skip to content

Commit 3b3eed8

Browse files
claudiu-mdavem330
authored andcommitted
net: mscc: ocelot: fix NULL pointer on LAG slave removal
lag_upper_info may be NULL on slave removal. 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 7afb3e5 commit 3b3eed8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/net/ethernet/mscc/ocelot.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1724,7 +1724,8 @@ static int ocelot_netdevice_event(struct notifier_block *unused,
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)