diff options
author | Arvid Brodin <arvid.brodin@alten.se> | 2014-07-04 17:37:27 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-07-08 14:35:31 -0400 |
commit | 51f3c605318b056ac5deb9079bbef2a976558827 (patch) | |
tree | 892ae91481ed018ce84f70a9b1c49ee0972d9406 /net/hsr/hsr_framereg.c | |
parent | e9aae56ea43ef4a32527b9d86c1f6b5eebfbd223 (diff) |
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.c | 6 |
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, | |||
455 | u16 *if2_seq) | 455 | u16 *if2_seq) |
456 | { | 456 | { |
457 | struct hsr_node *node; | 457 | struct hsr_node *node; |
458 | struct net_device *slave; | ||
458 | unsigned long tdiff; | 459 | unsigned long tdiff; |
459 | 460 | ||
460 | 461 | ||
@@ -491,8 +492,9 @@ int hsr_get_node_data(struct hsr_priv *hsr, | |||
491 | *if1_seq = node->seq_out[HSR_DEV_SLAVE_B]; | 492 | *if1_seq = node->seq_out[HSR_DEV_SLAVE_B]; |
492 | *if2_seq = node->seq_out[HSR_DEV_SLAVE_A]; | 493 | *if2_seq = node->seq_out[HSR_DEV_SLAVE_A]; |
493 | 494 | ||
494 | if ((node->AddrB_if != HSR_DEV_NONE) && hsr->slave[node->AddrB_if]) | 495 | slave = hsr->slave[node->AddrB_if]; |
495 | *addr_b_ifindex = hsr->slave[node->AddrB_if]->ifindex; | 496 | if ((node->AddrB_if != HSR_DEV_NONE) && slave) |
497 | *addr_b_ifindex = slave->ifindex; | ||
496 | else | 498 | else |
497 | *addr_b_ifindex = -1; | 499 | *addr_b_ifindex = -1; |
498 | 500 | ||