aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/mesh_pathtbl.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/mesh_pathtbl.c')
-rw-r--r--net/mac80211/mesh_pathtbl.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c
index 5845dc21ce85..727aa528c831 100644
--- a/net/mac80211/mesh_pathtbl.c
+++ b/net/mac80211/mesh_pathtbl.c
@@ -158,14 +158,14 @@ int mesh_path_add(u8 *dst, struct net_device *dev)
158 if (atomic_add_unless(&sdata->u.sta.mpaths, 1, MESH_MAX_MPATHS) == 0) 158 if (atomic_add_unless(&sdata->u.sta.mpaths, 1, MESH_MAX_MPATHS) == 0)
159 return -ENOSPC; 159 return -ENOSPC;
160 160
161 read_lock(&pathtbl_resize_lock);
162
163 new_mpath = kzalloc(sizeof(struct mesh_path), GFP_KERNEL); 161 new_mpath = kzalloc(sizeof(struct mesh_path), GFP_KERNEL);
164 if (!new_mpath) { 162 if (!new_mpath) {
165 atomic_dec(&sdata->u.sta.mpaths); 163 atomic_dec(&sdata->u.sta.mpaths);
166 err = -ENOMEM; 164 err = -ENOMEM;
167 goto endadd2; 165 goto endadd2;
168 } 166 }
167
168 read_lock(&pathtbl_resize_lock);
169 memcpy(new_mpath->dst, dst, ETH_ALEN); 169 memcpy(new_mpath->dst, dst, ETH_ALEN);
170 new_mpath->dev = dev; 170 new_mpath->dev = dev;
171 new_mpath->flags = 0; 171 new_mpath->flags = 0;
@@ -202,7 +202,6 @@ int mesh_path_add(u8 *dst, struct net_device *dev)
202 202
203endadd: 203endadd:
204 spin_unlock(&mesh_paths->hashwlock[hash_idx]); 204 spin_unlock(&mesh_paths->hashwlock[hash_idx]);
205endadd2:
206 read_unlock(&pathtbl_resize_lock); 205 read_unlock(&pathtbl_resize_lock);
207 if (!err && grow) { 206 if (!err && grow) {
208 struct mesh_table *oldtbl, *newtbl; 207 struct mesh_table *oldtbl, *newtbl;
@@ -219,6 +218,7 @@ endadd2:
219 mesh_table_free(oldtbl, false); 218 mesh_table_free(oldtbl, false);
220 write_unlock(&pathtbl_resize_lock); 219 write_unlock(&pathtbl_resize_lock);
221 } 220 }
221endadd2:
222 return err; 222 return err;
223} 223}
224 224