lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.22.394.2203141247120.2561@hadrien>
Date:   Mon, 14 Mar 2022 12:50:48 +0100 (CET)
From:   Julia Lawall <julia.lawall@...ia.fr>
To:     Dan Carpenter <dan.carpenter@...cle.com>
cc:     Joe Perches <joe@...ches.com>,
        James Smart <james.smart@...adcom.com>,
        kernel-janitors@...r.kernel.org,
        Dick Kennedy <dick.kennedy@...adcom.com>,
        "James E.J. Bottomley" <jejb@...ux.ibm.com>,
        "Martin K. Petersen" <martin.petersen@...cle.com>,
        linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org,
        Harshit Mogalapalli <harshit.m.mogalapalli@...cle.com>,
        Kees Cook <keescook@...omium.org>
Subject: Re: [PATCH 4/6] scsi: lpfc: use kzalloc



On Mon, 14 Mar 2022, Dan Carpenter wrote:

> On Sat, Mar 12, 2022 at 01:45:01PM -0800, Joe Perches wrote:
> > On Sat, 2022-03-12 at 11:27 +0100, Julia Lawall wrote:
> > > Use kzalloc instead of kmalloc + memset.
> > []
> > > diff --git a/drivers/scsi/lpfc/lpfc_debugfs.c b/drivers/scsi/lpfc/lpfc_debugfs.c
> > []
> > > @@ -6272,10 +6272,8 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
> > >  				 phba->hba_debugfs_root,
> > >  				 phba, &lpfc_debugfs_op_slow_ring_trc);
> > >  		if (!phba->slow_ring_trc) {
> > > -			phba->slow_ring_trc = kmalloc(
> > > -				(sizeof(struct lpfc_debugfs_trc) *
> > > -				lpfc_debugfs_max_slow_ring_trc),
> > > -				GFP_KERNEL);
> > > +			phba->slow_ring_trc = kzalloc((sizeof(struct lpfc_debugfs_trc) * lpfc_debugfs_max_slow_ring_trc),
> > > +						      GFP_KERNEL);
> >
> > kcalloc
> >
>
> Did someone have a Coccinelle script that converted kzalloc() to
> kcalloc()?

Not sure if I have ever done that.  A long time ago, I made one that
starts with kmalloc and picks kzalloc or kcalloc.  Perhaps Kees did such a
thing?

I'll see if it would be useful.

julia

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ