Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp2474861rdd; Fri, 12 Jan 2024 10:26:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IFrstJ1AvHrH191Atdz9R7KzNqUKQZLMaXpnv9m77qqMIYfZK1mz5coxD13KNoOSw5Xt0gT X-Received: by 2002:a62:6547:0:b0:6d9:b75e:ddc3 with SMTP id z68-20020a626547000000b006d9b75eddc3mr843115pfb.33.1705084012515; Fri, 12 Jan 2024 10:26:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705084012; cv=none; d=google.com; s=arc-20160816; b=PlZFpe5Toy44iQmZj2bVYwltlRPL9xKf3UQWlKQOtY02w3ptiDoEF7yp0DKMiPjAzK ReZGgYr43dgHYgecRX0F+F878EoYh9W4IGTGLUHZ6kE7creDB3AtDoLA3KY2KQ7wwFFb 6A7pbeJcQspfBzhB50NARPaQEHulGDpKvXOBhDr1vkULfedRGTrNATdaKvIe2uNzACX/ zpfaiSUbDRmtC5/+6G+tw/3pTfPo1e2SAx0/5sfGOiYICC+BAlVJnQa6qkjO7f92Jbjw AW/SDw00/l0c2jOchxhBjpUEThGzHZ085e2Eh0so5RSngCumuZDZnFVg5Kx5a3J2No9q vL+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=ui-outboundreport:content-transfer-encoding:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:message-id:date :subject:cc:to:from:dkim-signature; bh=q2K6z9V15OL39UZoiXCeqHY3MLPslGVNGROgLd/Tv1g=; fh=EmcGJF/ES/vY4etSLpRLOH5k8lPnjysM4Yi4e2xiS4w=; b=hLbb857WnyGJI4WMpgxmtskRKZysOSlzwGDiy6EwJa038nlvktvCNQtzO/Ts3P+3M7 lbfvs01OvFoTMVX8Pn8GKMiSqriexXeXhZ35ugMIwdlRd0kR/sTikrOTrmRWQJk/sagS q0j6PKYhOw//FL6EQXnZe3Xk2b9OhahEDwJYwJfbgV/5hz2N5Q4S6PRrmK1nGZaAM1ak WjHNpu0fQE3tEopnRmZC0yjH7sdEPl+ItZyQI0X7OU1nXVyruGgZDBiVEzO7Z3jWl6EA M4/5p8blA7o1BtqyGvOVk6fsd7QRosymwfgN8SBKqSz2JGSbBp6BGo40mnT+kh9TpsFJ wSAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.com header.s=s31663417 header.b=jEbrZzQ3; spf=pass (google.com: domain of linux-kernel+bounces-24966-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24966-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=gmx.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id x6-20020a056a00188600b006db1136b362si3835603pfh.33.2024.01.12.10.26.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jan 2024 10:26:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-24966-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.com header.s=s31663417 header.b=jEbrZzQ3; spf=pass (google.com: domain of linux-kernel+bounces-24966-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24966-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=gmx.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 03D00B213A2 for ; Fri, 12 Jan 2024 18:26:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AFF1617C95; Fri, 12 Jan 2024 18:26:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.com header.i=erick.archer@gmx.com header.b="jEbrZzQ3" Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C8E87175B0; Fri, 12 Jan 2024 18:26:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.com; s=s31663417; t=1705083982; x=1705688782; i=erick.archer@gmx.com; bh=+Gybv52t9GG+h/zrvAoxV5B+3VXNY3CX5/ikX0He3fo=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=jEbrZzQ3DAJzHbArawwFAvrR3181x7bOeVmyz70JTzN8gjaDzZUtwD2U8RbwN+0a Xz6YYW0D2OXBs7c4Y7ynAFvshBDL/ej7VETNM0GTfrlVzGSvwRGtnCzLS6dJaualA TSLoTKSXfcgHM2qSnhdlCoxsZ6MiMFRNeWs5QLlXEyfXIPHtXPKI7wLi6R26VZdrZ 12hvSDtCme+m6/xAiZHjnX5/1BaRgHQWo7LB4H7jsQ4DcPcsNglU+oOG45JapofVU Q0KlcZAb4GIy+oiZuNnYL6nxm+uWAjv1iIJnd/Eya8s4r0gNHH9m59nj9cTqVMBX+ AeUQBGIqOknavJlISQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from localhost.localdomain ([79.157.194.183]) by mail.gmx.net (mrgmx104 [212.227.17.174]) with ESMTPSA (Nemesis) id 1MQ5rU-1rkRSf3fuq-00M3wH; Fri, 12 Jan 2024 19:26:22 +0100 From: Erick Archer To: "James E.J. Bottomley" , "Martin K. Petersen" , "Gustavo A. R. Silva" Cc: Erick Archer , Kees Cook , Bjorn Helgaas , Justin Stitt , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: [PATCH] scsi: csiostor: Use kcalloc() instead of kzalloc() Date: Fri, 12 Jan 2024 19:26:03 +0100 Message-Id: <20240112182603.11048-1-erick.archer@gmx.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:VqSrX2QEK19EdjFd/yQN1WWLQ7POmZiuBsYckjEvZYo0v8/G3HX qVv85dL9MOxFSzsVUJBbubAuAQ4L0jePv3wpZwc3baUgn2dDWqC8tXUU2t08/r74MetNjUZ 3ZmF3fe/n0Is9WPmpv6bhGd/FoHp3ZpqVxMjni0QhkOl2Y6mBzRBzz3VJCWoLLzfz9y7m+x 0F7OSGrOna4uMSQBisglQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:gYeDrLFe1ck=;KD7kEcholIXzrSPNj27MNUcZjiV hy89Hnf1tkqrMmy37I0Y3eiF/8Az5bONZGq6EfvT7jTMFYnCMc08D+1ejNys8TUCJrKCqZE3I ypJDVqkS0c4sS2qhoLmCr94aJXmCA/3cOLEcFEMBK80eClLILo4ghKy3yvrtIOYJL0aUvzD+6 aSZwI3rtxlG0E6iCBqAlBhD8elVhh2X5mSwa9IbdHwNIEERMX/LXVvtj7DmAKb8MQf4Ti8WS+ hfwJQbhVV36bTvFVUD3jCLVOny/EXoz2G/Fh1ZSO/W0Y7UDK7b5Aji0rtFPXYrggMo50pbUOp ubJDN5guxEchE+OVtthlVuKZ1qqCTinn/J4xKe9ewBjLEFo53Adt7FhC4S8mSuNZHy1k3IUdC CIJy/8foyCctV1eo+1lfT7rigwliSeCfCGXFrKeFmmtb2bIiu+4q88BbCqMk+ITgTFoVOovnW HmX4x2Ho7PD06ekbNCJ0uBXipdsnKdbZnUUp9O3A1Oj6f3Lme8kpVTWnReYvjK/FLllBKFyM/ LQ+eQDaieYhxyk4zK4SvuAxDDMNqTOiWHNHkirb5KiX21rHpflJXNZ5HjQ/1FGk3di1gdgaoE gZ/GZJAOsUueQYjtSR2a3Qe7xIYzt59EsuGA6FFwyhjtbtoYHcp0IBPxBEQUBM5B3Dog9oSZo fSelG2p4GknyONSeduDNoihF4oSmV0Lw86pJN+8BQgZSYL5w9WRrdqhdzhw44N1foNWGaKsQD HYApzDY5GXCGdUAcSaeNk43n3UuYGnsxaAPCpGPQNee+ZeM5KplKNvb7R1d2ogF7lVFMt8uc5 zBY+ZA0n/Bgd22wugyhv/7/uaw3fs2rafepy8G1Ch0ymQ5DuO1ppsZvkhc9TKaHbAPnKuROSI rhMUJnXgbxQl/F+wRVntax6xyr+793O1BnY/bt6IaXuYQ0AGPxkJsBhKw1OScKig7jFiBRcJ6 uldUNMT8v2sysQQyOISacVd6D/o= Use 2-factor multiplication argument form kcalloc() instead of kzalloc(). Link: https://github.com/KSPP/linux/issues/162 Signed-off-by: Erick Archer =2D-- drivers/scsi/csiostor/csio_init.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/scsi/csiostor/csio_init.c b/drivers/scsi/csiostor/csi= o_init.c index d649b7a2a879..d72892e44fd1 100644 =2D-- a/drivers/scsi/csiostor/csio_init.c +++ b/drivers/scsi/csiostor/csio_init.c @@ -698,8 +698,7 @@ csio_lnodes_block_request(struct csio_hw *hw) struct csio_lnode **lnode_list; int cur_cnt =3D 0, ii; - lnode_list =3D kzalloc((sizeof(struct csio_lnode *) * hw->num_lns), - GFP_KERNEL); + lnode_list =3D kcalloc(hw->num_lns, sizeof(*lnode_list), GFP_KERNEL); if (!lnode_list) { csio_err(hw, "Failed to allocate lnodes_list"); return; @@ -737,8 +736,7 @@ csio_lnodes_unblock_request(struct csio_hw *hw) struct csio_lnode **lnode_list; int cur_cnt =3D 0, ii; - lnode_list =3D kzalloc((sizeof(struct csio_lnode *) * hw->num_lns), - GFP_KERNEL); + lnode_list =3D kcalloc(hw->num_lns, sizeof(*lnode_list), GFP_KERNEL); if (!lnode_list) { csio_err(hw, "Failed to allocate lnodes_list"); return; @@ -775,8 +773,7 @@ csio_lnodes_block_by_port(struct csio_hw *hw, uint8_t = portid) struct csio_lnode **lnode_list; int cur_cnt =3D 0, ii; - lnode_list =3D kzalloc((sizeof(struct csio_lnode *) * hw->num_lns), - GFP_KERNEL); + lnode_list =3D kcalloc(hw->num_lns, sizeof(*lnode_list), GFP_KERNEL); if (!lnode_list) { csio_err(hw, "Failed to allocate lnodes_list"); return; @@ -816,8 +813,7 @@ csio_lnodes_unblock_by_port(struct csio_hw *hw, uint8_= t portid) struct csio_lnode **lnode_list; int cur_cnt =3D 0, ii; - lnode_list =3D kzalloc((sizeof(struct csio_lnode *) * hw->num_lns), - GFP_KERNEL); + lnode_list =3D kcalloc(hw->num_lns, sizeof(*lnode_list), GFP_KERNEL); if (!lnode_list) { csio_err(hw, "Failed to allocate lnodes_list"); return; @@ -855,8 +851,7 @@ csio_lnodes_exit(struct csio_hw *hw, bool npiv) struct csio_lnode **lnode_list; int cur_cnt =3D 0, ii; - lnode_list =3D kzalloc((sizeof(struct csio_lnode *) * hw->num_lns), - GFP_KERNEL); + lnode_list =3D kcalloc(hw->num_lns, sizeof(*lnode_list), GFP_KERNEL); if (!lnode_list) { csio_err(hw, "lnodes_exit: Failed to allocate lnodes_list.\n"); return; =2D- 2.25.1