From bf4afc53b77aeaa48b5409da5c8da6bb4eff7f43 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sat, 21 Feb 2026 16:37:42 -0800 Subject: Convert 'alloc_obj' family to use the new default GFP_KERNEL argument This was done entirely with mindless brute force, using git grep -l '\ --- net/wireless/nl80211.c | 36 ++++++++++++++++++------------------ net/wireless/of.c | 2 +- net/wireless/reg.c | 12 ++++++------ net/wireless/sme.c | 2 +- net/wireless/tests/util.c | 2 +- net/wireless/wext-compat.c | 2 +- 6 files changed, 28 insertions(+), 28 deletions(-) (limited to 'net/wireless') diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 33782370fbaf..e25a15b9267d 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -1615,7 +1615,7 @@ nl80211_parse_connkeys(struct cfg80211_registered_device *rdev, if (!have_key) return NULL; - result = kzalloc_obj(*result, GFP_KERNEL); + result = kzalloc_obj(*result); if (!result) return ERR_PTR(-ENOMEM); @@ -3367,7 +3367,7 @@ static int nl80211_dump_wiphy_parse(struct sk_buff *skb, struct netlink_callback *cb, struct nl80211_dump_wiphy_state *state) { - struct nlattr **tb = kzalloc_objs(*tb, NUM_NL80211_ATTR, GFP_KERNEL); + struct nlattr **tb = kzalloc_objs(*tb, NUM_NL80211_ATTR); int ret; if (!tb) @@ -3419,7 +3419,7 @@ static int nl80211_dump_wiphy(struct sk_buff *skb, struct netlink_callback *cb) rtnl_lock(); if (!state) { - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (!state) { rtnl_unlock(); return -ENOMEM; @@ -6702,7 +6702,7 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info) nla_get_u8(info->attrs[NL80211_ATTR_SMPS_MODE]) != NL80211_SMPS_OFF) return -EOPNOTSUPP; - params = kzalloc_obj(*params, GFP_KERNEL); + params = kzalloc_obj(*params); if (!params) return -ENOMEM; @@ -6995,7 +6995,7 @@ static int nl80211_set_beacon(struct sk_buff *skb, struct genl_info *info) if (!wdev->links[link_id].ap.beacon_interval) return -EINVAL; - params = kzalloc_obj(*params, GFP_KERNEL); + params = kzalloc_obj(*params); if (!params) return -ENOMEM; @@ -7985,7 +7985,7 @@ static int nl80211_dump_station(struct sk_buff *skb, for (i = 0; i < IEEE80211_MLD_MAX_NUM_LINKS; i++) { sinfo.links[i] = - kzalloc_obj(*sinfo.links[0], GFP_KERNEL); + kzalloc_obj(*sinfo.links[0]); if (!sinfo.links[i]) { err = -ENOMEM; goto out_err; @@ -8049,7 +8049,7 @@ static int nl80211_get_station(struct sk_buff *skb, struct genl_info *info) return -EOPNOTSUPP; for (i = 0; i < IEEE80211_MLD_MAX_NUM_LINKS; i++) { - sinfo.links[i] = kzalloc_obj(*sinfo.links[0], GFP_KERNEL); + sinfo.links[i] = kzalloc_obj(*sinfo.links[0]); if (!sinfo.links[i]) { cfg80211_sinfo_release_content(&sinfo); return -ENOMEM; @@ -11520,7 +11520,7 @@ static int nl80211_channel_switch(struct sk_buff *skb, struct genl_info *info) if (err) goto free; - csa_attrs = kzalloc_objs(*csa_attrs, NL80211_ATTR_MAX + 1, GFP_KERNEL); + csa_attrs = kzalloc_objs(*csa_attrs, NL80211_ATTR_MAX + 1); if (!csa_attrs) { err = -ENOMEM; goto free; @@ -11780,7 +11780,7 @@ static int nl80211_dump_scan(struct sk_buff *skb, struct netlink_callback *cb) bool dump_include_use_data; int err; - attrbuf = kzalloc_objs(*attrbuf, NUM_NL80211_ATTR, GFP_KERNEL); + attrbuf = kzalloc_objs(*attrbuf, NUM_NL80211_ATTR); if (!attrbuf) return -ENOMEM; @@ -11920,7 +11920,7 @@ static int nl80211_dump_survey(struct sk_buff *skb, struct netlink_callback *cb) int res; bool radio_stats; - attrbuf = kzalloc_objs(*attrbuf, NUM_NL80211_ATTR, GFP_KERNEL); + attrbuf = kzalloc_objs(*attrbuf, NUM_NL80211_ATTR); if (!attrbuf) return -ENOMEM; @@ -13111,7 +13111,7 @@ static int nl80211_testmode_dump(struct sk_buff *skb, goto out_err; } } else { - attrbuf = kzalloc_objs(*attrbuf, NUM_NL80211_ATTR, GFP_KERNEL); + attrbuf = kzalloc_objs(*attrbuf, NUM_NL80211_ATTR); if (!attrbuf) { err = -ENOMEM; goto out_err; @@ -14935,7 +14935,7 @@ static int nl80211_parse_wowlan_nd(struct cfg80211_registered_device *rdev, struct nlattr **tb; int err; - tb = kzalloc_objs(*tb, NUM_NL80211_ATTR, GFP_KERNEL); + tb = kzalloc_objs(*tb, NUM_NL80211_ATTR); if (!tb) return -ENOMEM; @@ -15538,7 +15538,7 @@ static int nl80211_register_beacons(struct sk_buff *skb, struct genl_info *info) if (!(rdev->wiphy.flags & WIPHY_FLAG_REPORTS_OBSS)) return -EOPNOTSUPP; - nreg = kzalloc_obj(*nreg, GFP_KERNEL); + nreg = kzalloc_obj(*nreg); if (!nreg) return -ENOMEM; @@ -15895,7 +15895,7 @@ static int handle_nan_filter(struct nlattr *attr_filter, BUILD_BUG_ON(sizeof(*func->rx_filters) != sizeof(*func->tx_filters)); - filter = kzalloc_objs(*func->rx_filters, n_entries, GFP_KERNEL); + filter = kzalloc_objs(*func->rx_filters, n_entries); if (!filter) return -ENOMEM; @@ -15955,7 +15955,7 @@ static int nl80211_nan_add_func(struct sk_buff *skb, if (err) return err; - func = kzalloc_obj(*func, GFP_KERNEL); + func = kzalloc_obj(*func); if (!func) return -ENOMEM; @@ -16597,7 +16597,7 @@ static int nl80211_prepare_vendor_dump(struct sk_buff *skb, return 0; } - attrbuf = kzalloc_objs(*attrbuf, NUM_NL80211_ATTR, GFP_KERNEL); + attrbuf = kzalloc_objs(*attrbuf, NUM_NL80211_ATTR); if (!attrbuf) return -ENOMEM; @@ -16828,7 +16828,7 @@ static int nl80211_set_qos_map(struct sk_buff *skb, if (len % 2) return -EINVAL; - qos_map = kzalloc_obj(struct cfg80211_qos_map, GFP_KERNEL); + qos_map = kzalloc_obj(struct cfg80211_qos_map); if (!qos_map) return -ENOMEM; @@ -17528,7 +17528,7 @@ static int nl80211_color_change(struct sk_buff *skb, struct genl_info *info) if (err) return err; - tb = kzalloc_objs(*tb, NL80211_ATTR_MAX + 1, GFP_KERNEL); + tb = kzalloc_objs(*tb, NL80211_ATTR_MAX + 1); if (!tb) return -ENOMEM; diff --git a/net/wireless/of.c b/net/wireless/of.c index 35a3bcd84b6f..60a864465331 100644 --- a/net/wireless/of.c +++ b/net/wireless/of.c @@ -98,7 +98,7 @@ void wiphy_read_of_freq_limits(struct wiphy *wiphy) } n_freq_limits = len / sizeof(u32) / 2; - freq_limits = kzalloc_objs(*freq_limits, n_freq_limits, GFP_KERNEL); + freq_limits = kzalloc_objs(*freq_limits, n_freq_limits); if (!freq_limits) { err = -ENOMEM; goto out_kfree; diff --git a/net/wireless/reg.c b/net/wireless/reg.c index d6f3282fe986..4d7479ffda36 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c @@ -509,7 +509,7 @@ static int reg_schedule_apply(const struct ieee80211_regdomain *regdom) { struct reg_regdb_apply_request *request; - request = kzalloc_obj(struct reg_regdb_apply_request, GFP_KERNEL); + request = kzalloc_obj(struct reg_regdb_apply_request); if (!request) { kfree(regdom); return -ENOMEM; @@ -1098,7 +1098,7 @@ int reg_reload_regdb(void) /* reset regulatory domain */ current_regdomain = get_cfg80211_regdom(); - request = kzalloc_obj(*request, GFP_KERNEL); + request = kzalloc_obj(*request); if (!request) { err = -ENOMEM; goto out_unlock; @@ -3222,7 +3222,7 @@ static int regulatory_hint_core(const char *alpha2) { struct regulatory_request *request; - request = kzalloc_obj(struct regulatory_request, GFP_KERNEL); + request = kzalloc_obj(struct regulatory_request); if (!request) return -ENOMEM; @@ -3248,7 +3248,7 @@ int regulatory_hint_user(const char *alpha2, if (!is_world_regdom(alpha2) && !is_an_alpha2(alpha2)) return -EINVAL; - request = kzalloc_obj(struct regulatory_request, GFP_KERNEL); + request = kzalloc_obj(struct regulatory_request); if (!request) return -ENOMEM; @@ -3318,7 +3318,7 @@ int regulatory_hint(struct wiphy *wiphy, const char *alpha2) wiphy->regulatory_flags &= ~REGULATORY_CUSTOM_REG; - request = kzalloc_obj(struct regulatory_request, GFP_KERNEL); + request = kzalloc_obj(struct regulatory_request); if (!request) return -ENOMEM; @@ -3351,7 +3351,7 @@ void regulatory_hint_country_ie(struct wiphy *wiphy, enum nl80211_band band, if (country_ie_len < IEEE80211_COUNTRY_IE_MIN_LEN) return; - request = kzalloc_obj(*request, GFP_KERNEL); + request = kzalloc_obj(*request); if (!request) return; diff --git a/net/wireless/sme.c b/net/wireless/sme.c index cb1a75fda5ca..5b21432450d5 100644 --- a/net/wireless/sme.c +++ b/net/wireless/sme.c @@ -570,7 +570,7 @@ static int cfg80211_sme_connect(struct wireless_dev *wdev, if (wdev->conn) return -EINPROGRESS; - wdev->conn = kzalloc_obj(*wdev->conn, GFP_KERNEL); + wdev->conn = kzalloc_obj(*wdev->conn); if (!wdev->conn) return -ENOMEM; diff --git a/net/wireless/tests/util.c b/net/wireless/tests/util.c index 6f870b06307d..118f7fb4226d 100644 --- a/net/wireless/tests/util.c +++ b/net/wireless/tests/util.c @@ -17,7 +17,7 @@ int t_wiphy_init(struct kunit_resource *resource, void *ctx) struct wiphy *wiphy; struct t_wiphy_priv *priv; - ops = kzalloc_obj(*ops, GFP_KERNEL); + ops = kzalloc_obj(*ops); KUNIT_ASSERT_NOT_NULL(test, ops); wiphy = wiphy_new_nm(ops, sizeof(*priv), "kunit"); diff --git a/net/wireless/wext-compat.c b/net/wireless/wext-compat.c index 3ce845cd1936..55783a7f51c2 100644 --- a/net/wireless/wext-compat.c +++ b/net/wireless/wext-compat.c @@ -414,7 +414,7 @@ static int cfg80211_set_encryption(struct cfg80211_registered_device *rdev, * to do it first in case the allocation fails. Don't use wext. */ if (!wdev->wext.keys) { - wdev->wext.keys = kzalloc_obj(*wdev->wext.keys, GFP_KERNEL); + wdev->wext.keys = kzalloc_obj(*wdev->wext.keys); if (!wdev->wext.keys) return -ENOMEM; for (i = 0; i < 4; i++) -- cgit v1.2.3