Unverified Commit 924bcd44 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!10307 wifi: mac80211: mesh: Fix leak of mesh_preq_queue objects

parents 64b082bd a85c39a5
Loading
Loading
Loading
Loading
+13 −0
Original line number Original line Diff line number Diff line
@@ -739,10 +739,23 @@ void mesh_path_discard_frame(struct ieee80211_sub_if_data *sdata,
 */
 */
void mesh_path_flush_pending(struct mesh_path *mpath)
void mesh_path_flush_pending(struct mesh_path *mpath)
{
{
	struct ieee80211_sub_if_data *sdata = mpath->sdata;
	struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
	struct mesh_preq_queue *preq, *tmp;
	struct sk_buff *skb;
	struct sk_buff *skb;


	while ((skb = skb_dequeue(&mpath->frame_queue)) != NULL)
	while ((skb = skb_dequeue(&mpath->frame_queue)) != NULL)
		mesh_path_discard_frame(mpath->sdata, skb);
		mesh_path_discard_frame(mpath->sdata, skb);

	spin_lock_bh(&ifmsh->mesh_preq_queue_lock);
	list_for_each_entry_safe(preq, tmp, &ifmsh->preq_queue.list, list) {
		if (ether_addr_equal(mpath->dst, preq->dst)) {
			list_del(&preq->list);
			kfree(preq);
			--ifmsh->preq_queue_len;
		}
	}
	spin_unlock_bh(&ifmsh->mesh_preq_queue_lock);
}
}


/**
/**