[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4c9323077204a22683cd3ed92fea303a1a8b67fc.camel@perches.com>
Date: Mon, 15 Jun 2020 21:42:22 -0700
From: Joe Perches <joe@...ches.com>
To: "Satish Kharat (satishkh)" <satishkh@...co.com>,
"Gustavo A. R. Silva" <gustavoars@...nel.org>,
"Sesidhar Baddela (sebaddel)" <sebaddel@...co.com>,
"Karan Tilak Kumar (kartilak)" <kartilak@...co.com>,
"James E.J. Bottomley" <jejb@...ux.ibm.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>
Cc: "linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"Gustavo A. R. Silva" <gustavo@...eddedor.com>
Subject: Re: [PATCH][next] scsi: fnic: Replace vmalloc() + memset() with
vzalloc() and use array_size()
On Tue, 2020-06-16 at 00:19 +0000, Satish Kharat (satishkh) wrote:
> Reviewed-by: Satish Kharat <satishkh@...co.com>
>
>
> On 6/15/20, 3:49 PM, "Gustavo A. R. Silva" <gustavoars@...nel.org> wrote:
>
> Use vzalloc() instead of the vmalloc() and memset. Also, use array_size()
> instead of the open-coded version.
>
> This issue was found with the help of Coccinelle and, audited and fixed
> manually.
>
> Addresses-KSPP-ID: https://github.com/KSPP/linux/issues/83
> Signed-off-by: Gustavo A. R. Silva <gustavoars@...nel.org>
> ---
> drivers/scsi/fnic/fnic_trace.c | 16 ++++------------
> 1 file changed, 4 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/scsi/fnic/fnic_trace.c b/drivers/scsi/fnic/fnic_trace.c
[]
> @@ -488,7 +488,7 @@ int fnic_trace_buf_init(void)
> }
>
> fnic_trace_entries.page_offset =
> - vmalloc(array_size(fnic_max_trace_entries,
> + vzalloc(array_size(fnic_max_trace_entries,
> sizeof(unsigned long)));
Perhaps better as
kvcalloc(fnic_max_trace_entries, sizeof(unsigned long),
GFP_KERNEL);
Powered by blists - more mailing lists