diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index bd54a928bab4..daac83aa8988 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -14092,6 +14092,8 @@ static int nl80211_set_coalesce(struct sk_buff *skb, struct genl_info *info) error: for (i = 0; i < new_coalesce.n_rules; i++) { tmp_rule = &new_coalesce.rules[i]; + if (!tmp_rule) + continue; for (j = 0; j < tmp_rule->n_patterns; j++) kfree(tmp_rule->patterns[j].mask); kfree(tmp_rule->patterns);