summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBen Greear <greearb@candelatech.com>2014-09-25 14:22:18 -0700
committerJohannes Berg <johannes.berg@intel.com>2014-10-09 09:29:44 +0200
commitb7bc9679e4dffe1b5ab75b4ea19e410b7253fa38 (patch)
tree706005684100e0b66c032097d61b2effe52e1e13 /drivers
parent35a9ad8af0bb0fa3525e6d0d20e32551d226f38e (diff)
downloadlinux-b7bc9679e4dffe1b5ab75b4ea19e410b7253fa38.tar.gz
linux-b7bc9679e4dffe1b5ab75b4ea19e410b7253fa38.tar.bz2
linux-b7bc9679e4dffe1b5ab75b4ea19e410b7253fa38.zip
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: Ben Greear <greearb@candelatech.com> [rewrite commit message] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/mac80211_hwsim.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index babbdc1ce741..a74227d8a485 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -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,