Unverified Commit 4e6a3367 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

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

parents 8429baca 62d8b0ea
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -723,10 +723,23 @@ void mesh_path_discard_frame(struct ieee80211_sub_if_data *sdata,
 */
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;

	while ((skb = skb_dequeue(&mpath->frame_queue)) != NULL)
		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);
}

/**