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: <Pine.LNX.4.64.0708130545510.19318@localhost.localdomain>
Date:	Mon, 13 Aug 2007 05:47:01 -0400 (EDT)
From:	"Robert P. J. Day" <rpjday@...dspring.com>
To:	Surya Prabhakar N <surya.prabhakar@...ro.com>
cc:	dwmw2@...radead.org, linux-mtd@...ts.infradead.org,
	linux-kernel@...r.kernel.org
Subject: Re: [KJ-resend]replacing kmalloc with kzalloc in drivers/mtd/chips/cfi_probe.c

On Mon, 13 Aug 2007, Surya Prabhakar N wrote:

>
> Hi,
>    Replacing kmalloc with kzalloc and cleaning up memset in
> drivers/mtd/chips/cfi_probe.c. Kindly ignore the previous similar patch.
>
> Signed-off-by: Surya Prabhakar <surya.prabhakar@...ro.com>
> ---
>
> diff --git a/drivers/mtd/chips/cfi_probe.c b/drivers/mtd/chips/cfi_probe.c
> index 60e11a0..efb51f7 100644
> --- a/drivers/mtd/chips/cfi_probe.c
> +++ b/drivers/mtd/chips/cfi_probe.c
> @@ -203,14 +203,12 @@ static int __xipram cfi_chip_setup(struct map_info *map,
>  	if (!num_erase_regions)
>  		return 0;
>
> -	cfi->cfiq = kmalloc(sizeof(struct cfi_ident) + num_erase_regions * 4, GFP_KERNEL);
> +	cfi->cfiq = kzalloc(sizeof(struct cfi_ident) + num_erase_regions * 4, GFP_KERNEL);
>  	if (!cfi->cfiq) {
>  		printk(KERN_WARNING "%s: kmalloc failed for CFI ident structure\n", map->name);
>  		return 0;
>  	}
>
> -	memset(cfi->cfiq,0,sizeof(struct cfi_ident));
> -
>  	cfi->cfi_mode = CFI_MODE_CFI;

but that change is not precisely equivalent, it now clears more than
the original code.  as long as that's not a problem.

rday
-- 
========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://fsdev.net/wiki/index.php?title=Main_Page
========================================================================
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ