From: Markus Elfring <Markus.Elfring@web.de>
To: linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
kernel-janitors@vger.kernel.org,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
Johannes Berg <johannes@sipsolutions.net>,
Paolo Abeni <pabeni@redhat.com>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] wifi: cfg80211: Replace a label in cfg80211_parse_ml_sta_data()
Date: Sun, 31 Dec 2023 11:33:19 +0100 [thread overview]
Message-ID: <873097b9-5a0b-495b-83ae-f2247fbb512b@web.de> (raw)
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 31 Dec 2023 11:22:42 +0100
The kfree() function was called in one case by
the cfg80211_parse_ml_sta_data() function during error handling
even if the passed variable contained a null pointer.
This issue was detected by using the Coccinelle software.
Thus use an other label.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
net/wireless/scan.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/wireless/scan.c b/net/wireless/scan.c
index cf2131671eb6..492e30138418 100644
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -2693,7 +2693,7 @@ static void cfg80211_parse_ml_sta_data(struct wiphy *wiphy,
new_ie = kmalloc(IEEE80211_MAX_DATA_LEN, gfp);
if (!new_ie)
- goto out;
+ goto free_mle;
for (i = 0; i < ARRAY_SIZE(mle->sta_prof) && mle->sta_prof[i]; i++) {
const struct ieee80211_neighbor_ap_info *ap_info;
@@ -2812,8 +2812,8 @@ static void cfg80211_parse_ml_sta_data(struct wiphy *wiphy,
cfg80211_put_bss(wiphy, bss);
}
-out:
kfree(new_ie);
+free_mle:
kfree(mle);
}
--
2.43.0
reply other threads:[~2023-12-31 10:33 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=873097b9-5a0b-495b-83ae-f2247fbb512b@web.de \
--to=markus.elfring@web.de \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=johannes@sipsolutions.net \
--cc=kernel-janitors@vger.kernel.org \
--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 \
/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;
as well as URLs for NNTP newsgroup(s).