summaryrefslogtreecommitdiffstats
path: root/net/wireless
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2026-09-05 20:45:18 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2026-09-05 20:45:18 -0700
commit1fc5a74b108fc90951890ec513ac81869f5eaff1 (patch)
treeddd247abac0e8e148e4ded357db093bee4fe35ed /net/wireless
parent9f0346dcbea363787186c94ef94dd01aaa215afa (diff)
parent3a2c4d55e32ad65efebdb6de44eef3bfa08bb49d (diff)
downloadlinux-stable-1fc5a74b108fc90951890ec513ac81869f5eaff1.tar.gz
linux-stable-1fc5a74b108fc90951890ec513ac81869f5eaff1.zip
Merge tag 'kmalloc_obj-v7.3-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux
Pull kmalloc_obj conversions from Kees Cook: "Another run of the Coccinelle script for converting kmalloc() family of allocations to kmalloc_obj() via the existing rules in scripts/coccinelle/api/kmalloc_objs.cocci" * tag 'kmalloc_obj-v7.3-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: treewide: refresh kmalloc_obj() conversions drm/amd/display: Fix harmless type mismatch in allocation
Diffstat (limited to 'net/wireless')
-rw-r--r--net/wireless/core.c5
-rw-r--r--net/wireless/nl80211.c9
2 files changed, 5 insertions, 9 deletions
diff --git a/net/wireless/core.c b/net/wireless/core.c
index d13310fef..3032993ba 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -311,9 +311,8 @@ int cfg80211_nan_set_local_schedule(struct cfg80211_registered_device *rdev,
if (!sched->n_channels)
return 0;
- wdev->u.nan.chandefs = kcalloc(sched->n_channels,
- sizeof(*wdev->u.nan.chandefs),
- GFP_KERNEL);
+ wdev->u.nan.chandefs = kzalloc_objs(*wdev->u.nan.chandefs,
+ sched->n_channels);
if (!wdev->u.nan.chandefs)
return -ENOMEM;
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 44f2bad08..899b6374c 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -17330,8 +17330,7 @@ static int nl80211_parse_nan_channel(struct cfg80211_registered_device *rdev,
u8 n_rx_nss;
int ret;
- channel_parsed = kcalloc(NL80211_ATTR_MAX + 1, sizeof(*channel_parsed),
- GFP_KERNEL);
+ channel_parsed = kzalloc_objs(*channel_parsed, NL80211_ATTR_MAX + 1);
if (!channel_parsed)
return -ENOMEM;
@@ -17554,8 +17553,7 @@ static int nl80211_nan_set_peer_sched(struct sk_buff *skb,
}
if (n_channels) {
- nan_channels = kcalloc(n_channels, sizeof(*nan_channels),
- GFP_KERNEL);
+ nan_channels = kzalloc_objs(*nan_channels, n_channels);
if (!nan_channels)
return -ENOMEM;
}
@@ -17693,8 +17691,7 @@ static int nl80211_nan_set_local_sched(struct sk_buff *skb,
info->nlhdr, GENL_HDRLEN, rem)
n_channels++;
- sched = kzalloc(struct_size(sched, nan_channels, n_channels),
- GFP_KERNEL);
+ sched = kzalloc_flex(*sched, nan_channels, n_channels);
if (!sched)
return -ENOMEM;