Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp2486742rdd; Fri, 12 Jan 2024 10:51:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IGakK0MejxMtPCu9muoOjxPbi+1P5vaHvroMaYCh6xDPHvDf08VWiqDlV61b+8FQWI/T85b X-Received: by 2002:a05:600c:4f41:b0:40e:3be7:e828 with SMTP id m1-20020a05600c4f4100b0040e3be7e828mr906642wmq.104.1705085468869; Fri, 12 Jan 2024 10:51:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705085468; cv=none; d=google.com; s=arc-20160816; b=HqSsPxwjRd7LVrg5vkmh5Xgoz68Ey1B402i0EFibROLNaaovfVwMiiKUjfHzL3OWiS QuuxPL7I5ZphYqVAN5+jLotgd0H6Inla9pqk0Wp+NyJ/7oKn6Kj4cGCLpNt7KPuwF96+ x/kGfOKyc+6gFo6H0rXseTARHQ/sDkSO5Hmd1pVK9G/NgWBwi4UHNvZHun+YpgIbjpWq PIJJDYpANQx9pSvs9tS5XH5tx9vpBdGjuhA3B0pWEb0rbEJ/ACiMTHN3Iir3QVbU2Izy 3tsfsLzjECcrqXUydmyigu2esvYHYS/m4N/Ko0YYT10uz42wZvv31RlMyz6rmeC/PFlr tvIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=WN5oEk254ZaRQR4Ymvk869NpqFDbzV2Pr93bBRSvIRo=; fh=8hqy7zxIbNkePzMmUxhQlK/OeGLkabFjgCye55xfFgo=; b=We7z5Trv7HVwBP9/BEsYTi1qtHbwGwpj05gxPomil1907maDkB8YTy4AVCfXhEMz7t MS3vqOoAbrQKIcgNQuG3mCm4oGa5DoUiLlrxIrSHtY124xLBSXyQInH/aejprRLg8m0T OVuSPBWOednW9lUGTFU9GMJRM68NQg3QEFLD8h55vf0a+TnryeeVMqIlfghL+6J861RE RQkEfEysLEvSzsqIEYR2DxFN1/7BcAzcwGNuZxP6GjoXRPwC5SeanIKmju0GpqZdyq5K xdVmKm4ccPD2A4dNMxX6WlYzRvSVNlaYWOMXZcQtirDrJiAdvsZaSdxk7SHS6aKz+WTT AyPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@embeddedor.com header.s=default header.b=hoQ+h3x+; spf=pass (google.com: domain of linux-kernel+bounces-24981-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24981-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id s17-20020a170906bc5100b00a2a360dbd0asi1570757ejv.26.2024.01.12.10.51.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jan 2024 10:51:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-24981-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=fail header.i=@embeddedor.com header.s=default header.b=hoQ+h3x+; spf=pass (google.com: domain of linux-kernel+bounces-24981-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24981-linux.lists.archive=gmail.com@vger.kernel.org" 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 am.mirrors.kernel.org (Postfix) with ESMTPS id C22AC1F2496E for ; Fri, 12 Jan 2024 18:44:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 869D815AD0; Fri, 12 Jan 2024 18:43:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=embeddedor.com header.i=@embeddedor.com header.b="hoQ+h3x+" Received: from omta38.uswest2.a.cloudfilter.net (omta38.uswest2.a.cloudfilter.net [35.89.44.37]) (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 03BA9156DD for ; Fri, 12 Jan 2024 18:43:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=embeddedor.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=embeddedor.com Received: from eig-obgw-5006a.ext.cloudfilter.net ([10.0.29.179]) by cmsmtp with ESMTPS id Nza4r5vFYoMN9OMVQrWizh; Fri, 12 Jan 2024 18:43:48 +0000 Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with ESMTPS id OMVPrkeXkim6EOMVPrgYVX; Fri, 12 Jan 2024 18:43:48 +0000 X-Authority-Analysis: v=2.4 cv=Qft1A+Xv c=1 sm=1 tr=0 ts=65a18864 a=1YbLdUo/zbTtOZ3uB5T3HA==:117 a=WzbPXH4gqzPVN0x6HrNMNA==:17 a=OWjo9vPv0XrRhIrVQ50Ab3nP57M=:19 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=IkcTkHD0fZMA:10 a=dEuoMetlWLkA:10 a=wYkD_t78qR0A:10 a=NEAV23lmAAAA:8 a=7YfXLusrAAAA:8 a=beM7OXizrj4IlsfoTHwA:9 a=QEXdDO2ut3YA:10 a=SLz71HocmBbuEhFRYD3r:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=embeddedor.com; s=default; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=WN5oEk254ZaRQR4Ymvk869NpqFDbzV2Pr93bBRSvIRo=; b=hoQ+h3x+imlNEWxUJKBGFHyIu4 uJuUL24a3DF6wvOgZf6CzqaDEXWkXBSPYMemz2IHFmFQA6c9NNFihtQVuzWgu9WgGUAtsUH5rLoYM ujADmEEAizAuHZsE9vTELnINHQsXv2+TcU1sxVEyZltY/MYedr9pysc0TQDqHhYITYXWmIFO1oCE7 ps/6AZN0fNKItjtG3hp6bF0ylfL91caP3jxOAYGHIfu681EMAFwSmvBVb4tWfsyfxa27KkaGrKtQi ApAOeFwlKNEFNjxBA2LYPN1K9Q5Cd7C9laPOHt464ah8Za8QE8z9PxOFe0+6Yign0gmFq0rRtIL9Z DE77ToCQ==; Received: from 187-162-21-192.static.axtel.net ([187.162.21.192]:58358 helo=[192.168.15.10]) by gator4166.hostgator.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96.2) (envelope-from ) id 1rOMVO-003hk2-2R; Fri, 12 Jan 2024 12:43:46 -0600 Message-ID: <1a48103c-cd7a-4425-8c17-89530f394a7f@embeddedor.com> Date: Fri, 12 Jan 2024 12:43:23 -0600 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] scsi: csiostor: Use kcalloc() instead of kzalloc() To: Erick Archer , "James E.J. Bottomley" , "Martin K. Petersen" , "Gustavo A. R. Silva" Cc: Kees Cook , Bjorn Helgaas , Justin Stitt , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org References: <20240112182603.11048-1-erick.archer@gmx.com> Content-Language: en-US From: "Gustavo A. R. Silva" In-Reply-To: <20240112182603.11048-1-erick.archer@gmx.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 187.162.21.192 X-Source-L: No X-Exim-ID: 1rOMVO-003hk2-2R X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 187-162-21-192.static.axtel.net ([192.168.15.10]) [187.162.21.192]:58358 X-Source-Auth: gustavo@embeddedor.com X-Email-Count: 2 X-Org: HG=hgshared;ORG=hostgator; X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfHlcqlkNHedCKewnr2uBB5VNZ3Im17TZ6fUS6NQqiGEBz3DQLxZJIQgIUaOiPyIwlOrIYTipcaMe8jrB3pEc7sp4Mhn42VmJG2Oxssc/kVt13srAAMFs D6Ci6lE9zYMZU/TrwqdXpDqVS7ARis6nrnowYRcFSDQmytzzi4+sIP/h7z+XuR7NP3ovgmOEQkDHAV8Pwd+QT3q1KxYkfV5h/2Wnn/loMT3Cll8U/IE12c4e On 1/12/24 12:26, Erick Archer wrote: > Use 2-factor multiplication argument form kcalloc() instead > of kzalloc(). > > Link: https://github.com/KSPP/linux/issues/162 > Signed-off-by: Erick Archer > --- > 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/csio_init.c > index d649b7a2a879..d72892e44fd1 100644 > --- 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 = 0, ii; > > - lnode_list = kzalloc((sizeof(struct csio_lnode *) * hw->num_lns), > - GFP_KERNEL); > + lnode_list = kcalloc(hw->num_lns, sizeof(*lnode_list), GFP_KERNEL); You should also mention and describe these `sizeof` changes in the changelog text. Thanks -- Gustavo