浏览代码

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>
Javier Cardona 14 年之前
父节点
当前提交
86d7f9f35d
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      net/mac80211/mesh_pathtbl.c

+ 4 - 2
net/mac80211/mesh_pathtbl.c

@@ -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 mpath_node *node = container_of(rp, struct mpath_node, rcu);
 	struct ieee80211_sub_if_data *sdata = node->mpath->sdata;
 	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);
 	atomic_dec(&sdata->u.mesh.mpaths);
 	kfree(node->mpath);
 	kfree(node->mpath);
 	kfree(node);
 	kfree(node);
@@ -768,7 +769,8 @@ static void mesh_path_node_free(struct hlist_node *p, bool free_leafs)
 	mpath = node->mpath;
 	mpath = node->mpath;
 	hlist_del_rcu(p);
 	hlist_del_rcu(p);
 	if (free_leafs) {
 	if (free_leafs) {
-		del_timer_sync(&mpath->timer);
+		if (mpath->timer.function)
+			del_timer_sync(&mpath->timer);
 		kfree(mpath);
 		kfree(mpath);
 	}
 	}
 	kfree(node);
 	kfree(node);