diff options
author | Javier Cardona <javier@cozybit.com> | 2011-08-09 19:45:05 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-08-24 13:59:42 -0400 |
commit | 86d7f9f35dcc686d57465798201e678040916979 (patch) | |
tree | 74f9606f497dac5b1c6a784a2fb04a5d308e0b92 /net/mac80211/mesh_pathtbl.c | |
parent | 7646887a5390123475fdd621620b9f270b38df98 (diff) |
mac80211: fix mpath timer NULL function
If we have an mpath whose timer has not been initialized, don't try to
delete it.
Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/mesh_pathtbl.c')
-rw-r--r-- | net/mac80211/mesh_pathtbl.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c index bd6b8b3e873a..bfd7638e235f 100644 --- a/net/mac80211/mesh_pathtbl.c +++ b/net/mac80211/mesh_pathtbl.c | |||
@@ -619,7 +619,8 @@ static void mesh_path_node_reclaim(struct rcu_head *rp) | |||
619 | struct mpath_node *node = container_of(rp, struct mpath_node, rcu); | 619 | struct mpath_node *node = container_of(rp, struct mpath_node, rcu); |
620 | struct ieee80211_sub_if_data *sdata = node->mpath->sdata; | 620 | struct ieee80211_sub_if_data *sdata = node->mpath->sdata; |
621 | 621 | ||
622 | del_timer_sync(&node->mpath->timer); | 622 | if (node->mpath->timer.function) |
623 | del_timer_sync(&node->mpath->timer); | ||
623 | atomic_dec(&sdata->u.mesh.mpaths); | 624 | atomic_dec(&sdata->u.mesh.mpaths); |
624 | kfree(node->mpath); | 625 | kfree(node->mpath); |
625 | kfree(node); | 626 | kfree(node); |
@@ -768,7 +769,8 @@ static void mesh_path_node_free(struct hlist_node *p, bool free_leafs) | |||
768 | mpath = node->mpath; | 769 | mpath = node->mpath; |
769 | hlist_del_rcu(p); | 770 | hlist_del_rcu(p); |
770 | if (free_leafs) { | 771 | if (free_leafs) { |
771 | del_timer_sync(&mpath->timer); | 772 | if (mpath->timer.function) |
773 | del_timer_sync(&mpath->timer); | ||
772 | kfree(mpath); | 774 | kfree(mpath); |
773 | } | 775 | } |
774 | kfree(node); | 776 | kfree(node); |