Commit 3b3eed8e authored by Claudiu Manoil's avatar Claudiu Manoil Committed by David S. Miller

net: mscc: ocelot: fix NULL pointer on LAG slave removal

lag_upper_info may be NULL on slave removal.

Fixes: dc96ee37 ("net: mscc: ocelot: add bonding support")
Signed-off-by: default avatarClaudiu Manoil <claudiu.manoil@nxp.com>
Signed-off-by: default avatarVladimir Oltean <olteanv@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7afb3e57
...@@ -1724,7 +1724,8 @@ static int ocelot_netdevice_event(struct notifier_block *unused, ...@@ -1724,7 +1724,8 @@ static int ocelot_netdevice_event(struct notifier_block *unused,
struct netdev_lag_upper_info *lag_upper_info = info->upper_info; struct netdev_lag_upper_info *lag_upper_info = info->upper_info;
struct netlink_ext_ack *extack; struct netlink_ext_ack *extack;
if (lag_upper_info->tx_type != NETDEV_LAG_TX_TYPE_HASH) { if (lag_upper_info &&
lag_upper_info->tx_type != NETDEV_LAG_TX_TYPE_HASH) {
extack = netdev_notifier_info_to_extack(&info->info); extack = netdev_notifier_info_to_extack(&info->info);
NL_SET_ERR_MSG_MOD(extack, "LAG device using unsupported Tx type"); NL_SET_ERR_MSG_MOD(extack, "LAG device using unsupported Tx type");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment