summaryrefslogtreecommitdiff
path: root/net/wireless
diff options
context:
space:
mode:
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>2025-10-20 10:57:45 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-11-13 15:36:39 -0500
commitea6d9fc6c74c5576d1b650c5eb9a90facb4dbe08 (patch)
tree0968e841d40f984e340020aa14f2973c578068bb /net/wireless
parent4f33913b88542df283a863660724fcac1c895c8e (diff)
downloadlinux-ea6d9fc6c74c5576d1b650c5eb9a90facb4dbe08.tar.gz
linux-ea6d9fc6c74c5576d1b650c5eb9a90facb4dbe08.tar.bz2
linux-ea6d9fc6c74c5576d1b650c5eb9a90facb4dbe08.zip
wifi: nl80211: call kfree without a NULL check
[ Upstream commit 249e1443e3d57e059925bdb698f53e4d008fc106 ] Coverity is unhappy because we may leak old_radio_rts_threshold. Since this pointer is only valid in the context of the function and kfree is NULL pointer safe, don't check and just call kfree. Note that somehow, we were checking old_rts_threshold to free old_radio_rts_threshold which is a bit odd. Fixes: 264637941cf4 ("wifi: cfg80211: Add Support to Set RTS Threshold for each Radio") Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Link: https://patch.msgid.link/20251020075745.44168-1-emmanuel.grumbach@intel.com Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net/wireless')
-rw-r--r--net/wireless/nl80211.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 852573423e52..46b29ed0bd2e 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -4012,8 +4012,7 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info)
rdev->wiphy.txq_quantum = old_txq_quantum;
}
- if (old_rts_threshold)
- kfree(old_radio_rts_threshold);
+ kfree(old_radio_rts_threshold);
return result;
}