mac80211: fix mpath timer NULL function
authorJavier Cardona <javier@cozybit.com>
Tue, 9 Aug 2011 23:45:05 +0000 (16:45 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 24 Aug 2011 17:59:42 +0000 (13:59 -0400)
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>
net/mac80211/mesh_pathtbl.c

index bd6b8b3e873a28c955b083c0c70e8ec35f30e97d..bfd7638e235fe9a1668e8c2fd0ce98a535b4df36 100644 (file)
@@ -619,7 +619,8 @@ static void mesh_path_node_reclaim(struct rcu_head *rp)
        struct mpath_node *node = container_of(rp, struct mpath_node, rcu);
        struct ieee80211_sub_if_data *sdata = node->mpath->sdata;
 
-       del_timer_sync(&node->mpath->timer);
+       if (node->mpath->timer.function)
+               del_timer_sync(&node->mpath->timer);
        atomic_dec(&sdata->u.mesh.mpaths);
        kfree(node->mpath);
        kfree(node);
@@ -768,7 +769,8 @@ static void mesh_path_node_free(struct hlist_node *p, bool free_leafs)
        mpath = node->mpath;
        hlist_del_rcu(p);
        if (free_leafs) {
-               del_timer_sync(&mpath->timer);
+               if (mpath->timer.function)
+                       del_timer_sync(&mpath->timer);
                kfree(mpath);
        }
        kfree(node);