Skip to content

Commit 801ea33

Browse files
committed
wifi: nl80211: don't free NULL coalescing rule
If the parsing fails, we can dereference a NULL pointer here. Cc: [email protected] Fixes: be29b99 ("cfg80211/nl80211: Add packet coalesce support") Reviewed-by: Miriam Rachel Korenblit <[email protected]> Link: https://msgid.link/20240418105220.b328f80406e7.Id75d961050deb05b3e4e354e024866f350c68103@changeid Signed-off-by: Johannes Berg <[email protected]>
1 parent 2fb5dfe commit 801ea33

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

net/wireless/nl80211.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14030,6 +14030,8 @@ static int nl80211_set_coalesce(struct sk_buff *skb, struct genl_info *info)
1403014030
error:
1403114031
for (i = 0; i < new_coalesce.n_rules; i++) {
1403214032
tmp_rule = &new_coalesce.rules[i];
14033+
if (!tmp_rule)
14034+
continue;
1403314035
for (j = 0; j < tmp_rule->n_patterns; j++)
1403414036
kfree(tmp_rule->patterns[j].mask);
1403514037
kfree(tmp_rule->patterns);

0 commit comments

Comments
 (0)