From 484bd64bdc2721224e90e131607398e546cf84b1 Mon Sep 17 00:00:00 2001 From: Dmitry Kandybka Date: Thu, 3 Oct 2024 12:59:12 +0300 Subject: [PATCH] wifi: nl80211: remove redundant null pointer check in coalescing In 'cfg80211_free_coalesce', '&coalesce->rules[i]' is a pointer to VLA member of 'struct cfg80211_coalesce' and should never be NULL, so redundant check may be dropped. I think this is correct, but I haven't tested it seriously. Compile tested only. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Dmitry Kandybka Link: https://patch.msgid.link/20241003095912.218465-1-d.kandybka@gmail.com Signed-off-by: Johannes Berg --- net/wireless/nl80211.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index d51bcb4e9108c..4e3609176880f 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -14061,8 +14061,6 @@ void cfg80211_free_coalesce(struct cfg80211_coalesce *coalesce) for (i = 0; i < coalesce->n_rules; i++) { rule = &coalesce->rules[i]; - if (!rule) - continue; for (j = 0; j < rule->n_patterns; j++) kfree(rule->patterns[j].mask); kfree(rule->patterns); -- 2.50.1