mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-09 06:33:34 +00:00
ice: use devm_kcalloc() instead of devm_kzalloc()
Use 2-factor multiplication argument form devm_kcalloc() instead of devm_kzalloc(). Link: https://github.com/KSPP/linux/issues/162 Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
This commit is contained in:
parent
7c1b694ada
commit
6f3323536a
@ -706,7 +706,7 @@ ice_create_init_fdir_rule(struct ice_pf *pf, enum ice_fltr_ptype flow)
|
||||
if (!seg)
|
||||
return -ENOMEM;
|
||||
|
||||
tun_seg = devm_kzalloc(dev, sizeof(*seg) * ICE_FD_HW_SEG_MAX,
|
||||
tun_seg = devm_kcalloc(dev, sizeof(*seg), ICE_FD_HW_SEG_MAX,
|
||||
GFP_KERNEL);
|
||||
if (!tun_seg) {
|
||||
devm_kfree(dev, seg);
|
||||
@ -1068,7 +1068,7 @@ ice_cfg_fdir_xtrct_seq(struct ice_pf *pf, struct ethtool_rx_flow_spec *fsp,
|
||||
if (!seg)
|
||||
return -ENOMEM;
|
||||
|
||||
tun_seg = devm_kzalloc(dev, sizeof(*seg) * ICE_FD_HW_SEG_MAX,
|
||||
tun_seg = devm_kcalloc(dev, sizeof(*seg), ICE_FD_HW_SEG_MAX,
|
||||
GFP_KERNEL);
|
||||
if (!tun_seg) {
|
||||
devm_kfree(dev, seg);
|
||||
|
@ -343,7 +343,7 @@ int ice_setup_tx_ring(struct ice_tx_ring *tx_ring)
|
||||
/* warn if we are about to overwrite the pointer */
|
||||
WARN_ON(tx_ring->tx_buf);
|
||||
tx_ring->tx_buf =
|
||||
devm_kzalloc(dev, sizeof(*tx_ring->tx_buf) * tx_ring->count,
|
||||
devm_kcalloc(dev, sizeof(*tx_ring->tx_buf), tx_ring->count,
|
||||
GFP_KERNEL);
|
||||
if (!tx_ring->tx_buf)
|
||||
return -ENOMEM;
|
||||
@ -475,7 +475,7 @@ int ice_setup_rx_ring(struct ice_rx_ring *rx_ring)
|
||||
/* warn if we are about to overwrite the pointer */
|
||||
WARN_ON(rx_ring->rx_buf);
|
||||
rx_ring->rx_buf =
|
||||
devm_kzalloc(dev, sizeof(*rx_ring->rx_buf) * rx_ring->count,
|
||||
devm_kcalloc(dev, sizeof(*rx_ring->rx_buf), rx_ring->count,
|
||||
GFP_KERNEL);
|
||||
if (!rx_ring->rx_buf)
|
||||
return -ENOMEM;
|
||||
|
Loading…
Reference in New Issue
Block a user