Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6224fed6 authored by Ben Greear's avatar Ben Greear Committed by Alistair Strachan
Browse files

UPSTREAM: mac80211_hwsim: fix memory leak on netlink TX failure



If the packet can't be delivered to userspace (at all or
quickly enough) then it can leak - fix that.

Signed-off-by: default avatarBen Greear <greearb@candelatech.com>
[rewrite commit message]
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
(cherry picked from commit b7bc9679e4dffe1b5ab75b4ea19e410b7253fa38)
Bug: 70214720
Change-Id: I8e125100ee10954273c99f5ba2359833f376f3c2
Signed-off-by: default avatarAlistair Strachan <astrachan@google.com>
parent 5527faf1
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -862,7 +862,7 @@ static void mac80211_hwsim_tx_frame_nl(struct ieee80211_hw *hw,
	if (skb_queue_len(&data->pending) >= MAX_QUEUE) {
		/* Droping until WARN_QUEUE level */
		while (skb_queue_len(&data->pending) >= WARN_QUEUE)
			skb_dequeue(&data->pending);
			ieee80211_free_txskb(hw, skb_dequeue(&data->pending));
	}

	skb = genlmsg_new(GENLMSG_DEFAULT_SIZE, GFP_ATOMIC);
@@ -921,6 +921,7 @@ static void mac80211_hwsim_tx_frame_nl(struct ieee80211_hw *hw,

nla_put_failure:
	printk(KERN_DEBUG "mac80211_hwsim: error occurred in %s\n", __func__);
	ieee80211_free_txskb(hw, my_skb);
}

static bool hwsim_chans_compat(struct ieee80211_channel *c1,