diff options
Diffstat (limited to 'net/ethtool')
| -rw-r--r-- | net/ethtool/cmis_cdb.c | 2 | ||||
| -rw-r--r-- | net/ethtool/common.c | 6 | ||||
| -rw-r--r-- | net/ethtool/ioctl.c | 4 | ||||
| -rw-r--r-- | net/ethtool/module.c | 2 | ||||
| -rw-r--r-- | net/ethtool/mse.c | 4 | ||||
| -rw-r--r-- | net/ethtool/tsconfig.c | 6 | ||||
| -rw-r--r-- | net/ethtool/tsinfo.c | 4 |
7 files changed, 14 insertions, 14 deletions
diff --git a/net/ethtool/cmis_cdb.c b/net/ethtool/cmis_cdb.c index 3057576bc81e..674439bedd49 100644 --- a/net/ethtool/cmis_cdb.c +++ b/net/ethtool/cmis_cdb.c @@ -276,7 +276,7 @@ ethtool_cmis_cdb_init(struct net_device *dev, struct ethtool_cmis_cdb *cdb; int err; - cdb = kzalloc(sizeof(*cdb), GFP_KERNEL); + cdb = kzalloc_obj(*cdb, GFP_KERNEL); if (!cdb) return ERR_PTR(-ENOMEM); diff --git a/net/ethtool/common.c b/net/ethtool/common.c index 5fae329795c8..7a302a93f52c 100644 --- a/net/ethtool/common.c +++ b/net/ethtool/common.c @@ -687,7 +687,7 @@ static int ethtool_get_max_rxnfc_channel(struct net_device *dev, u64 *max) if (rule_cnt <= 0) return -EINVAL; - info = kvzalloc(struct_size(info, rule_locs, rule_cnt), GFP_KERNEL); + info = kvzalloc_flex(*info, rule_locs, rule_cnt, GFP_KERNEL); if (!info) return -ENOMEM; @@ -770,7 +770,7 @@ static u32 ethtool_get_max_rxfh_channel(struct net_device *dev) if (dev_size == 0) return current_max; - rxfh.indir = kcalloc(dev_size, sizeof(rxfh.indir[0]), GFP_USER); + rxfh.indir = kzalloc_objs(rxfh.indir[0], dev_size, GFP_USER); if (!rxfh.indir) return U32_MAX; @@ -841,7 +841,7 @@ int ethtool_check_rss_ctx_busy(struct net_device *dev, u32 rss_context) if (rule_cnt < 0) return -EINVAL; - info = kvzalloc(struct_size(info, rule_locs, rule_cnt), GFP_KERNEL); + info = kvzalloc_flex(*info, rule_locs, rule_cnt, GFP_KERNEL); if (!info) return -ENOMEM; diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c index 9431e305b233..b4e7c6ccf9f3 100644 --- a/net/ethtool/ioctl.c +++ b/net/ethtool/ioctl.c @@ -3040,7 +3040,7 @@ ethtool_set_per_queue_coalesce(struct net_device *dev, bitmap_from_arr32(queue_mask, per_queue_opt->queue_mask, MAX_NUM_QUEUE); n_queue = bitmap_weight(queue_mask, MAX_NUM_QUEUE); - tmp = backup = kmalloc_array(n_queue, sizeof(*backup), GFP_KERNEL); + tmp = backup = kmalloc_objs(*backup, n_queue, GFP_KERNEL); if (!backup) return -ENOMEM; @@ -3554,7 +3554,7 @@ int dev_ethtool(struct net *net, struct ifreq *ifr, void __user *useraddr) if (copy_from_user(ðcmd, useraddr, sizeof(ethcmd))) return -EFAULT; - state = kzalloc(sizeof(*state), GFP_KERNEL); + state = kzalloc_obj(*state, GFP_KERNEL); if (!state) return -ENOMEM; diff --git a/net/ethtool/module.c b/net/ethtool/module.c index 4d4e0a82579a..d033a20aa48c 100644 --- a/net/ethtool/module.c +++ b/net/ethtool/module.c @@ -301,7 +301,7 @@ module_flash_fw_schedule(struct net_device *dev, const char *file_name, struct ethtool_module_fw_flash *module_fw; int err; - module_fw = kzalloc(sizeof(*module_fw), GFP_KERNEL); + module_fw = kzalloc_obj(*module_fw, GFP_KERNEL); if (!module_fw) return -ENOMEM; diff --git a/net/ethtool/mse.c b/net/ethtool/mse.c index 6aac004c3ffc..4de15aad543b 100644 --- a/net/ethtool/mse.c +++ b/net/ethtool/mse.c @@ -64,8 +64,8 @@ static int mse_get_channels(struct phy_device *phydev, if (!data->capability.supported_caps) return 0; - data->snapshots = kcalloc(PHY_MSE_CHANNEL_COUNT, - sizeof(*data->snapshots), GFP_KERNEL); + data->snapshots = kzalloc_objs(*data->snapshots, PHY_MSE_CHANNEL_COUNT, + GFP_KERNEL); if (!data->snapshots) return -ENOMEM; diff --git a/net/ethtool/tsconfig.c b/net/ethtool/tsconfig.c index 169b413b31fc..acd0477b3a2d 100644 --- a/net/ethtool/tsconfig.c +++ b/net/ethtool/tsconfig.c @@ -202,10 +202,10 @@ static int tsconfig_send_reply(struct net_device *dev, struct genl_info *info) int reply_len = 0; int ret; - req_info = kzalloc(sizeof(*req_info), GFP_KERNEL); + req_info = kzalloc_obj(*req_info, GFP_KERNEL); if (!req_info) return -ENOMEM; - reply_data = kmalloc(sizeof(*reply_data), GFP_KERNEL); + reply_data = kmalloc_obj(*reply_data, GFP_KERNEL); if (!reply_data) { kfree(req_info); return -ENOMEM; @@ -280,7 +280,7 @@ tsconfig_set_hwprov_from_desc(struct net_device *dev, source = HWTSTAMP_SOURCE_PHYLIB; } - hwprov = kzalloc(sizeof(*hwprov), GFP_KERNEL); + hwprov = kzalloc_obj(*hwprov, GFP_KERNEL); if (!hwprov) return ERR_PTR(-ENOMEM); diff --git a/net/ethtool/tsinfo.c b/net/ethtool/tsinfo.c index 8c654caa6805..df9c7de9a640 100644 --- a/net/ethtool/tsinfo.c +++ b/net/ethtool/tsinfo.c @@ -505,10 +505,10 @@ int ethnl_tsinfo_start(struct netlink_callback *cb) BUILD_BUG_ON(sizeof(*ctx) > sizeof(cb->ctx)); - req_info = kzalloc(sizeof(*req_info), GFP_KERNEL); + req_info = kzalloc_obj(*req_info, GFP_KERNEL); if (!req_info) return -ENOMEM; - reply_data = kzalloc(sizeof(*reply_data), GFP_KERNEL); + reply_data = kzalloc_obj(*reply_data, GFP_KERNEL); if (!reply_data) { ret = -ENOMEM; goto free_req_info; |
