Skip to content

Commit fd56bac

Browse files
committed
wifi: nl80211: call kfree without a NULL check
JIRA: https://issues.redhat.com/browse/RHEL-114889 commit 249e144 Author: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Date: Mon Oct 20 10:57:45 2025 +0300 wifi: nl80211: call kfree without a NULL check 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: 2646379 ("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: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
1 parent e97a4b0 commit fd56bac

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

net/wireless/nl80211.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4017,8 +4017,7 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info)
40174017
rdev->wiphy.txq_quantum = old_txq_quantum;
40184018
}
40194019

4020-
if (old_rts_threshold)
4021-
kfree(old_radio_rts_threshold);
4020+
kfree(old_radio_rts_threshold);
40224021
return result;
40234022
}
40244023

0 commit comments

Comments
 (0)