Skip to content

Commit 249e144

Browse files
egrumbachjmberg-intel
authored andcommitted
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>
1 parent ed6a473 commit 249e144

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

net/wireless/nl80211.c

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

4139-
if (old_rts_threshold)
4140-
kfree(old_radio_rts_threshold);
4139+
kfree(old_radio_rts_threshold);
41414140
return result;
41424141
}
41434142

0 commit comments

Comments
 (0)