Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp590522pxb; Wed, 6 Oct 2021 11:06:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxDVguZuFMutzd4qA5bnWc9KqAvoblc2hswJ1kdEuREgkklssxd+lKAF+P4+HOvzFZ5/75+ X-Received: by 2002:a17:90a:1d8:: with SMTP id 24mr136140pjd.69.1633543579522; Wed, 06 Oct 2021 11:06:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633543579; cv=none; d=google.com; s=arc-20160816; b=MXBcoUTKHbrCGVM/x4KLLx8ULMwBLqSQib0ryznbbOk7Qg7Me+f/PNBybFF3hFoCIi tZH/pnF2R98+OObxsjDon+ABNh6CwWYrfyBS+m9N2z7FBZPrQpRufqw+cyaF9EG0of+C HnkQ0UtDECzWDhOwsDFn4627jgXz/4civpQ8MleiaN6/Ik8M1r1qznUlhrmDckGV+Ujm h9yU9aJzzfPGuou4uLRXH5c9zD4QyTXMh2pz5WjUAEDX3sQnasz66poiLcjRYEzV/50O LCDfOB7O9pK3MTvjicMHyG0NFGD4U30T3Af/RQJVBPayxZI09jf1xjfGBQ4RScAQA8Z+ 74eA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=4OCWlJXOQ3yCeWZ35Jk4F4dY5JiLQsWh5sswLljIpuw=; b=zADXb98fV2JjBRAgnZIzvD3F07VeJsMawgBCuxbdQQ5xWNci4hBCDPf+rp9QejP9/1 7KTpmM3a+/DGnX62nVB5yQUqPfS1mfOsyI0PeVxbMlYR5HYrszcp/GmvUMKjF/eEnV6/ 7W5C+OBGjvYBhHx87S9fyx/duBJJzJpuLyRO6ccBnGxIp/7uBVZCW5IZTZ3orpAi1tMb xP1qtEYYVLqeglOh59vLN42hytVrawGbkmB3VEqSQdP7RG6e94UPaXZ0/GLbfkLL/6Qz mtaqYU3m9SToLxYDEjeXFinXQjPR+741VaSAtkJ0d8414sRLqxaiTSAYTncTVqYalSLb UxUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=e9HZWeue; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a6si27223758pgq.109.2021.10.06.11.05.58; Wed, 06 Oct 2021 11:06:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=e9HZWeue; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239208AbhJFSG4 (ORCPT + 99 others); Wed, 6 Oct 2021 14:06:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:41628 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232019AbhJFSGz (ORCPT ); Wed, 6 Oct 2021 14:06:55 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 60CA661037; Wed, 6 Oct 2021 18:05:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1633543503; bh=mphWiOSjWVve4063iT9iLB+Ae/xfjYf+gdyYkUHB2/Y=; h=Date:From:To:Cc:Subject:From; b=e9HZWeueYaTquf0esaeqBWa+qbUPx9RRyl1y3/SlMhT0F4LiGEEpruzhqsIcVOExJ Il5t2TN7bFbTG3YnDOEQA9+MCerGxYNZ0uZvYHehxgKy5syHlbYsfqhdaL67Nn0F9k 8SLgZoM2/uewdLe3CLgkzhuN8aL16jj2x9Y/SjeugZQxhxTDGER6SSRg3q8nM41Bfn 7BnIz/5DAGCpJo/QvWxZ5cmQ/mfAGvlBSNZOAfxHBvqPZOJz0lbxl6VkWlqC99gz6e UillWofcVuceyoH5OSO4cqbX4S+8sG6w3uX1L207aLtgyvwVF4fLR6uQaBUL+v6KHq 082UUeqLM0iXA== Date: Wed, 6 Oct 2021 13:09:08 -0500 From: "Gustavo A. R. Silva" To: Jesse Brandeburg , Tony Nguyen , "David S. Miller" , Jakub Kicinski Cc: intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" , linux-hardening@vger.kernel.org Subject: [PATCH][next] ice: use devm_kcalloc() instead of devm_kzalloc() Message-ID: <20211006180908.GA913430@embeddedor> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/net/ethernet/intel/ice/ice_ethtool_fdir.c | 4 ++-- drivers/net/ethernet/intel/ice/ice_txrx.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_ethtool_fdir.c b/drivers/net/ethernet/intel/ice/ice_ethtool_fdir.c index 16de603b280c..38960bcc384c 100644 --- a/drivers/net/ethernet/intel/ice/ice_ethtool_fdir.c +++ b/drivers/net/ethernet/intel/ice/ice_ethtool_fdir.c @@ -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); diff --git a/drivers/net/ethernet/intel/ice/ice_txrx.c b/drivers/net/ethernet/intel/ice/ice_txrx.c index 13b2bdc25b0d..fd10f8548feb 100644 --- a/drivers/net/ethernet/intel/ice/ice_txrx.c +++ b/drivers/net/ethernet/intel/ice/ice_txrx.c @@ -340,7 +340,7 @@ int ice_setup_tx_ring(struct ice_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; @@ -464,7 +464,7 @@ int ice_setup_rx_ring(struct ice_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; -- 2.27.0