[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191105215014.12492-3-olteanv@gmail.com>
Date: Tue, 5 Nov 2019 23:50:14 +0200
From: Vladimir Oltean <olteanv@...il.com>
To: jakub.kicinski@...ronome.com, davem@...emloft.net
Cc: andrew@...n.ch, f.fainelli@...il.com,
alexandre.belloni@...tlin.com, netdev@...r.kernel.org,
Claudiu Manoil <claudiu.manoil@....com>,
Vladimir Oltean <olteanv@...il.com>
Subject: [PATCH net 2/2] net: mscc: ocelot: fix NULL pointer on LAG slave removal
From: Claudiu Manoil <claudiu.manoil@....com>
lag_upper_info may be NULL on slave removal.
Fixes: dc96ee3730fc ("net: mscc: ocelot: add bonding support")
Signed-off-by: Claudiu Manoil <claudiu.manoil@....com>
Signed-off-by: Vladimir Oltean <olteanv@...il.com>
---
drivers/net/ethernet/mscc/ocelot.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mscc/ocelot.c b/drivers/net/ethernet/mscc/ocelot.c
index dbf09fcf61f1..672ea1342add 100644
--- a/drivers/net/ethernet/mscc/ocelot.c
+++ b/drivers/net/ethernet/mscc/ocelot.c
@@ -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");
--
2.17.1
Powered by blists - more mailing lists