Message ID | 20240822074743.1366561-1-yujiaoliang@vivo.com (mailing list archive) |
---|---|
State | Awaiting Upstream |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [v4] wifi: cfg80211: Use kmemdup_array instead of kmemdup for multiple allocation | expand |
diff --git a/net/wireless/util.c b/net/wireless/util.c index 9a7c3adc8a3b..e7c1ac2a0f2d 100644 --- a/net/wireless/util.c +++ b/net/wireless/util.c @@ -2435,8 +2435,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;