diff options
Diffstat (limited to 'net/batman-adv/translation-table.c')
-rw-r--r-- | net/batman-adv/translation-table.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c index a66c2dcd1088..2ab83d7fb1f8 100644 --- a/net/batman-adv/translation-table.c +++ b/net/batman-adv/translation-table.c | |||
@@ -141,13 +141,14 @@ static void tt_orig_list_entry_free_rcu(struct rcu_head *rcu) | |||
141 | struct tt_orig_list_entry *orig_entry; | 141 | struct tt_orig_list_entry *orig_entry; |
142 | 142 | ||
143 | orig_entry = container_of(rcu, struct tt_orig_list_entry, rcu); | 143 | orig_entry = container_of(rcu, struct tt_orig_list_entry, rcu); |
144 | atomic_dec(&orig_entry->orig_node->tt_size); | ||
145 | orig_node_free_ref(orig_entry->orig_node); | 144 | orig_node_free_ref(orig_entry->orig_node); |
146 | kfree(orig_entry); | 145 | kfree(orig_entry); |
147 | } | 146 | } |
148 | 147 | ||
149 | static void tt_orig_list_entry_free_ref(struct tt_orig_list_entry *orig_entry) | 148 | static void tt_orig_list_entry_free_ref(struct tt_orig_list_entry *orig_entry) |
150 | { | 149 | { |
150 | /* to avoid race conditions, immediately decrease the tt counter */ | ||
151 | atomic_dec(&orig_entry->orig_node->tt_size); | ||
151 | call_rcu(&orig_entry->rcu, tt_orig_list_entry_free_rcu); | 152 | call_rcu(&orig_entry->rcu, tt_orig_list_entry_free_rcu); |
152 | } | 153 | } |
153 | 154 | ||
@@ -910,7 +911,6 @@ void tt_global_del_orig(struct bat_priv *bat_priv, | |||
910 | } | 911 | } |
911 | spin_unlock_bh(list_lock); | 912 | spin_unlock_bh(list_lock); |
912 | } | 913 | } |
913 | atomic_set(&orig_node->tt_size, 0); | ||
914 | orig_node->tt_initialised = false; | 914 | orig_node->tt_initialised = false; |
915 | } | 915 | } |
916 | 916 | ||
@@ -2031,10 +2031,10 @@ bool is_ap_isolated(struct bat_priv *bat_priv, uint8_t *src, uint8_t *dst) | |||
2031 | { | 2031 | { |
2032 | struct tt_local_entry *tt_local_entry = NULL; | 2032 | struct tt_local_entry *tt_local_entry = NULL; |
2033 | struct tt_global_entry *tt_global_entry = NULL; | 2033 | struct tt_global_entry *tt_global_entry = NULL; |
2034 | bool ret = true; | 2034 | bool ret = false; |
2035 | 2035 | ||
2036 | if (!atomic_read(&bat_priv->ap_isolation)) | 2036 | if (!atomic_read(&bat_priv->ap_isolation)) |
2037 | return false; | 2037 | goto out; |
2038 | 2038 | ||
2039 | tt_local_entry = tt_local_hash_find(bat_priv, dst); | 2039 | tt_local_entry = tt_local_hash_find(bat_priv, dst); |
2040 | if (!tt_local_entry) | 2040 | if (!tt_local_entry) |
@@ -2044,10 +2044,10 @@ bool is_ap_isolated(struct bat_priv *bat_priv, uint8_t *src, uint8_t *dst) | |||
2044 | if (!tt_global_entry) | 2044 | if (!tt_global_entry) |
2045 | goto out; | 2045 | goto out; |
2046 | 2046 | ||
2047 | if (_is_ap_isolated(tt_local_entry, tt_global_entry)) | 2047 | if (!_is_ap_isolated(tt_local_entry, tt_global_entry)) |
2048 | goto out; | 2048 | goto out; |
2049 | 2049 | ||
2050 | ret = false; | 2050 | ret = true; |
2051 | 2051 | ||
2052 | out: | 2052 | out: |
2053 | if (tt_global_entry) | 2053 | if (tt_global_entry) |