summaryrefslogtreecommitdiff
path: root/net/hsr/hsr_slave.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2015-03-26 17:50:42 -0700
committerMark Brown <broonie@kernel.org>2015-03-26 17:50:42 -0700
commit1be38e041f8eaa935f370aa0f34dd7a2fe39b1d8 (patch)
tree2d89734fc831593784bd411be03a1b9649de4c9d /net/hsr/hsr_slave.c
parent6935224da2482a261c786501fbccb1dc4a675225 (diff)
parentbc465aa9d045feb0e13b4a8f32cc33c1943f62d6 (diff)
Merge tag 'v4.0-rc5' into spi-bcm2835
Linux 4.0-rc5
Diffstat (limited to 'net/hsr/hsr_slave.c')
-rw-r--r--net/hsr/hsr_slave.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/net/hsr/hsr_slave.c b/net/hsr/hsr_slave.c
index a348dcbcd683..7d37366cc695 100644
--- a/net/hsr/hsr_slave.c
+++ b/net/hsr/hsr_slave.c
@@ -181,8 +181,10 @@ void hsr_del_port(struct hsr_port *port)
list_del_rcu(&port->port_list);
if (port != master) {
- netdev_update_features(master->dev);
- dev_set_mtu(master->dev, hsr_get_max_mtu(hsr));
+ if (master != NULL) {
+ netdev_update_features(master->dev);
+ dev_set_mtu(master->dev, hsr_get_max_mtu(hsr));
+ }
netdev_rx_handler_unregister(port->dev);
dev_set_promiscuity(port->dev, -1);
}
@@ -192,5 +194,7 @@ void hsr_del_port(struct hsr_port *port)
*/
synchronize_rcu();
- dev_put(port->dev);
+
+ if (port != master)
+ dev_put(port->dev);
}