Skip to content

Commit

Permalink
net: mscc: ocelot: fix NULL pointer on LAG slave removal
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Claudiu Manoil authored and David S. Miller committed Nov 6, 2019
1 parent 7afb3e5 commit 3b3eed8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/net/ethernet/mscc/ocelot.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 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);
NL_SET_ERR_MSG_MOD(extack, "LAG device using unsupported Tx type");

Expand Down

0 comments on commit 3b3eed8

Please sign in to comment.