diff options
Diffstat (limited to 'net/mac80211/mesh_pathtbl.c')
-rw-r--r-- | net/mac80211/mesh_pathtbl.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c index 727aa528c831..1d2d051e5976 100644 --- a/net/mac80211/mesh_pathtbl.c +++ b/net/mac80211/mesh_pathtbl.c | |||
@@ -164,13 +164,19 @@ int mesh_path_add(u8 *dst, struct net_device *dev) | |||
164 | err = -ENOMEM; | 164 | err = -ENOMEM; |
165 | goto endadd2; | 165 | goto endadd2; |
166 | } | 166 | } |
167 | new_node = kmalloc(sizeof(struct mpath_node), GFP_KERNEL); | ||
168 | if (!new_node) { | ||
169 | kfree(new_mpath); | ||
170 | atomic_dec(&sdata->u.sta.mpaths); | ||
171 | err = -ENOMEM; | ||
172 | goto endadd2; | ||
173 | } | ||
167 | 174 | ||
168 | read_lock(&pathtbl_resize_lock); | 175 | read_lock(&pathtbl_resize_lock); |
169 | memcpy(new_mpath->dst, dst, ETH_ALEN); | 176 | memcpy(new_mpath->dst, dst, ETH_ALEN); |
170 | new_mpath->dev = dev; | 177 | new_mpath->dev = dev; |
171 | new_mpath->flags = 0; | 178 | new_mpath->flags = 0; |
172 | skb_queue_head_init(&new_mpath->frame_queue); | 179 | skb_queue_head_init(&new_mpath->frame_queue); |
173 | new_node = kmalloc(sizeof(struct mpath_node), GFP_KERNEL); | ||
174 | new_node->mpath = new_mpath; | 180 | new_node->mpath = new_mpath; |
175 | new_mpath->timer.data = (unsigned long) new_mpath; | 181 | new_mpath->timer.data = (unsigned long) new_mpath; |
176 | new_mpath->timer.function = mesh_path_timer; | 182 | new_mpath->timer.function = mesh_path_timer; |