summaryrefslogtreecommitdiffstats
path: root/net/hsr/hsr_framereg.c
diff options
context:
space:
mode:
authorArvid Brodin <arvid.brodin@alten.se>2014-07-04 23:37:27 +0200
committerDavid S. Miller <davem@davemloft.net>2014-07-08 20:35:31 +0200
commit51f3c605318b056ac5deb9079bbef2a976558827 (patch)
tree892ae91481ed018ce84f70a9b1c49ee0972d9406 /net/hsr/hsr_framereg.c
parentnet/hsr: Operstate handling cleanup. (diff)
downloadlinux-51f3c605318b056ac5deb9079bbef2a976558827.tar.xz
linux-51f3c605318b056ac5deb9079bbef2a976558827.zip
net/hsr: Move slave init to hsr_slave.c.
Also try to prevent some possible slave dereference race conditions. This is finalized in the next patch, which abandons the slave array in favour of a list_head list and list RCU. Signed-off-by: Arvid Brodin <arvid.brodin@alten.se> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/hsr/hsr_framereg.c')
-rw-r--r--net/hsr/hsr_framereg.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/hsr/hsr_framereg.c b/net/hsr/hsr_framereg.c
index 79e3f7ff6654..3666f94c526f 100644
--- a/net/hsr/hsr_framereg.c
+++ b/net/hsr/hsr_framereg.c
@@ -455,6 +455,7 @@ int hsr_get_node_data(struct hsr_priv *hsr,
u16 *if2_seq)
{
struct hsr_node *node;
+ struct net_device *slave;
unsigned long tdiff;
@@ -491,8 +492,9 @@ int hsr_get_node_data(struct hsr_priv *hsr,
*if1_seq = node->seq_out[HSR_DEV_SLAVE_B];
*if2_seq = node->seq_out[HSR_DEV_SLAVE_A];
- if ((node->AddrB_if != HSR_DEV_NONE) && hsr->slave[node->AddrB_if])
- *addr_b_ifindex = hsr->slave[node->AddrB_if]->ifindex;
+ slave = hsr->slave[node->AddrB_if];
+ if ((node->AddrB_if != HSR_DEV_NONE) && slave)
+ *addr_b_ifindex = slave->ifindex;
else
*addr_b_ifindex = -1;