public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Dmitry Antipov <dmantipov@yandex.ru>,
	Johannes Berg <johannes.berg@intel.com>,
	Sasha Levin <sashal@kernel.org>,
	johannes@sipsolutions.net, davem@davemloft.net,
	edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
	linux-wireless@vger.kernel.org, netdev@vger.kernel.org
Subject: [PATCH AUTOSEL 6.6 19/20] wifi: mac80211: free skb on error path in ieee80211_beacon_get_ap()
Date: Tue,  3 Sep 2024 15:23:51 -0400	[thread overview]
Message-ID: <20240903192425.1107562-19-sashal@kernel.org> (raw)
In-Reply-To: <20240903192425.1107562-1-sashal@kernel.org>

From: Dmitry Antipov <dmantipov@yandex.ru>

[ Upstream commit 786c5be9ac29a39b6f37f1fdd2ea59d0fe35d525 ]

In 'ieee80211_beacon_get_ap()', free allocated skb in case of error
returned by 'ieee80211_beacon_protect()'. Compile tested only.

Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Link: https://patch.msgid.link/20240805142035.227847-1-dmantipov@yandex.ru
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/mac80211/tx.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 46b02a6ae0a36..415e951e4138a 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -5311,8 +5311,10 @@ ieee80211_beacon_get_ap(struct ieee80211_hw *hw,
 	if (beacon->tail)
 		skb_put_data(skb, beacon->tail, beacon->tail_len);
 
-	if (ieee80211_beacon_protect(skb, local, sdata, link) < 0)
+	if (ieee80211_beacon_protect(skb, local, sdata, link) < 0) {
+		dev_kfree_skb(skb);
 		return NULL;
+	}
 
 	ieee80211_beacon_get_finish(hw, vif, link, offs, beacon, skb,
 				    chanctx_conf, csa_off_base);
-- 
2.43.0


  parent reply	other threads:[~2024-09-03 20:44 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-03 19:23 [PATCH AUTOSEL 6.6 01/20] ASoC: SOF: mediatek: Add missing board compatible Sasha Levin
2024-09-03 19:23 ` [PATCH AUTOSEL 6.6 02/20] ASoC: mediatek: mt8188: Mark AFE_DAC_CON0 register as volatile Sasha Levin
2024-09-03 19:23 ` [PATCH AUTOSEL 6.6 03/20] ASoC: allow module autoloading for table db1200_pids Sasha Levin
2024-09-03 19:23 ` [PATCH AUTOSEL 6.6 04/20] ASoC: allow module autoloading for table board_ids Sasha Levin
2024-09-03 19:23 ` [PATCH AUTOSEL 6.6 05/20] ALSA: hda/realtek - Fixed ALC256 headphone no sound Sasha Levin
2024-09-03 19:23 ` [PATCH AUTOSEL 6.6 06/20] ALSA: hda/realtek - FIxed ALC285 " Sasha Levin
2024-09-03 19:23 ` [PATCH AUTOSEL 6.6 07/20] scsi: lpfc: Fix overflow build issue Sasha Levin
2024-09-03 19:23 ` [PATCH AUTOSEL 6.6 08/20] pinctrl: at91: make it work with current gpiolib Sasha Levin
2024-09-03 19:23 ` [PATCH AUTOSEL 6.6 09/20] hwmon: (asus-ec-sensors) remove VRM temp X570-E GAMING Sasha Levin
2024-09-03 19:23 ` [PATCH AUTOSEL 6.6 10/20] microblaze: don't treat zero reserved memory regions as error Sasha Levin
2024-09-03 19:23 ` [PATCH AUTOSEL 6.6 11/20] platform/x86: x86-android-tablets: Make Lenovo Yoga Tab 3 X90F DMI match less strict Sasha Levin
2024-09-03 19:23 ` [PATCH AUTOSEL 6.6 12/20] net: ftgmac100: Ensure tx descriptor updates are visible Sasha Levin
2024-09-03 19:23 ` [PATCH AUTOSEL 6.6 13/20] LoongArch: Define ARCH_IRQ_INIT_FLAGS as IRQ_NOPROBE Sasha Levin
2024-09-03 19:23 ` [PATCH AUTOSEL 6.6 14/20] wifi: iwlwifi: lower message level for FW buffer destination Sasha Levin
2024-09-03 19:23 ` [PATCH AUTOSEL 6.6 15/20] wifi: iwlwifi: mvm: fix iwl_mvm_scan_fits() calculation Sasha Levin
2024-09-03 19:23 ` [PATCH AUTOSEL 6.6 16/20] wifi: iwlwifi: mvm: fix iwl_mvm_max_scan_ie_fw_cmd_room() Sasha Levin
2024-09-03 19:23 ` [PATCH AUTOSEL 6.6 17/20] wifi: iwlwifi: mvm: pause TCM when the firmware is stopped Sasha Levin
2024-09-03 19:23 ` [PATCH AUTOSEL 6.6 18/20] wifi: iwlwifi: mvm: don't wait for tx queues if firmware is dead Sasha Levin
2024-09-03 19:23 ` Sasha Levin [this message]
2024-09-03 19:23 ` [PATCH AUTOSEL 6.6 20/20] wifi: iwlwifi: clear trans->state earlier upon error Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240903192425.1107562-19-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=davem@davemloft.net \
    --cc=dmantipov@yandex.ru \
    --cc=edumazet@google.com \
    --cc=johannes.berg@intel.com \
    --cc=johannes@sipsolutions.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox