diff --git a/net/wireless/util.c b/net/wireless/util.c index edeeb056fe4d..f49b55724f83 100644 --- a/net/wireless/util.c +++ b/net/wireless/util.c @@ -2437,8 +2437,8 @@ int cfg80211_iter_combinations(struct wiphy *wiphy, if (params->num_different_channels > c->num_different_channels) continue; - limits = kmemdup(c->limits, sizeof(limits[0]) * c->n_limits, - GFP_KERNEL); + limits = kmemdup_array(c->limits, c->n_limits, sizeof(*limits), + GFP_KERNEL); if (!limits) return -ENOMEM;