mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: "Satish Kharat (satishkh)" <satishkh@cisco.com>,
	"Gustavo A. R. Silva" <gustavoars@kernel.org>,
	"Sesidhar Baddela (sebaddel)" <sebaddel@cisco.com>,
	"Karan Tilak Kumar (kartilak)" <kartilak@cisco.com>,
	"James E.J. Bottomley" <jejb@linux.ibm.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Gustavo A. R. Silva" <gustavo@embeddedor.com>
Subject: Re: [PATCH][next] scsi: fnic: Replace vmalloc() + memset() with vzalloc() and use array_size()
Date: Mon, 15 Jun 2020 21:42:22 -0700	[thread overview]
Message-ID: <4c9323077204a22683cd3ed92fea303a1a8b67fc.camel@perches.com> (raw)
In-Reply-To: <873653F8-8FBB-4A9B-9380-B476674ECADE@cisco.com>

On Tue, 2020-06-16 at 00:19 +0000, Satish Kharat (satishkh) wrote:
> Reviewed-by: Satish Kharat <satishkh@cisco.com>
> 
> 
> On 6/15/20, 3:49 PM, "Gustavo A. R. Silva" <gustavoars@kernel.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@kernel.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);



      reply	other threads:[~2020-06-16  4:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-15 22:54 Gustavo A. R. Silva
2020-06-16  0:19 ` Satish Kharat (satishkh)
2020-06-16  4:42   ` Joe Perches [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4c9323077204a22683cd3ed92fea303a1a8b67fc.camel@perches.com \
    --to=joe@perches.com \
    --cc=gustavo@embeddedor.com \
    --cc=gustavoars@kernel.org \
    --cc=jejb@linux.ibm.com \
    --cc=kartilak@cisco.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=satishkh@cisco.com \
    --cc=sebaddel@cisco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®