diff mbox series

wifi: cfg80211: Replace a label in cfg80211_parse_ml_sta_data()

Message ID 873097b9-5a0b-495b-83ae-f2247fbb512b@web.de (mailing list archive)
State Awaiting Upstream
Delegated to: Netdev Maintainers
Headers show
Series wifi: cfg80211: Replace a label in cfg80211_parse_ml_sta_data() | expand

Checks

Context Check Description
netdev/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1113 this patch: 1113
netdev/cc_maintainers success CCed 6 of 6 maintainers
netdev/build_clang success Errors and warnings before: 1140 this patch: 1140
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 1140 this patch: 1140
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 17 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Markus Elfring Dec. 31, 2023, 10:33 a.m. UTC
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(-)

--
2.43.0
diff mbox series

Patch

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);
 }