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] [day] [month] [year] [list]
Message-ID: <20190627194645.3d0af6b8@xps13>
Date:   Thu, 27 Jun 2019 19:46:45 +0200
From:   Miquel Raynal <miquel.raynal@...tlin.com>
To:     Fuqian Huang <huangfq.daxian@...il.com>
Cc:     Richard Weinberger <richard@....at>,
        David Woodhouse <dwmw2@...radead.org>,
        Brian Norris <computersforpeace@...il.com>,
        Marek Vasut <marek.vasut@...il.com>,
        Vignesh Raghavendra <vigneshr@...com>,
        Boris Brezillon <bbrezillon@...nel.org>,
        Kate Stewart <kstewart@...uxfoundation.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        linux-mtd@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 35/87] mtd: nand: replace kmalloc and memset with
 kzalloc in nand_bch.c

Hi Fuqian,

Fuqian Huang <huangfq.daxian@...il.com> wrote on Fri, 28 Jun 2019
01:39:05 +0800:

> kmalloc + memset(0) -> kzalloc
> 
> Signed-off-by: Fuqian Huang <huangfq.daxian@...il.com>
> ---
>  drivers/mtd/nand/raw/nand_bch.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/mtd/nand/raw/nand_bch.c b/drivers/mtd/nand/raw/nand_bch.c
> index 55aa4c1cd414..17527310c3a1 100644
> --- a/drivers/mtd/nand/raw/nand_bch.c
> +++ b/drivers/mtd/nand/raw/nand_bch.c
> @@ -170,7 +170,7 @@ struct nand_bch_control *nand_bch_init(struct mtd_info *mtd)
>  		goto fail;
>  	}
>  
> -	nbc->eccmask = kmalloc(eccbytes, GFP_KERNEL);
> +	nbc->eccmask = kzalloc(eccbytes, GFP_KERNEL);
>  	nbc->errloc = kmalloc_array(t, sizeof(*nbc->errloc), GFP_KERNEL);
>  	if (!nbc->eccmask || !nbc->errloc)
>  		goto fail;
> @@ -182,7 +182,6 @@ struct nand_bch_control *nand_bch_init(struct mtd_info *mtd)
>  		goto fail;
>  
>  	memset(erased_page, 0xff, eccsize);
> -	memset(nbc->eccmask, 0, eccbytes);
>  	encode_bch(nbc->bch, erased_page, eccsize, nbc->eccmask);
>  	kfree(erased_page);
>  

Are there any guidelines on this topic that I missed? Otherwise I don't
think this is important to change.


Thanks,
Miquèl

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ