nl80211: validate number of probe response CSA counters
[firefly-linux-kernel-4.4.55.git] / net / wireless / nl80211.c
index 5d89f13a98dbafaa8b8921cd6df2ed7e570ccd66..bf65f31bd55ec61dce5d80f088dfd3c5a3d6cd1d 100644 (file)
@@ -6628,7 +6628,7 @@ static int nl80211_channel_switch(struct sk_buff *skb, struct genl_info *info)
 
                params.n_counter_offsets_presp = len / sizeof(u16);
                if (rdev->wiphy.max_num_csa_counters &&
-                   (params.n_counter_offsets_beacon >
+                   (params.n_counter_offsets_presp >
                     rdev->wiphy.max_num_csa_counters))
                        return -EINVAL;