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]
Date:	Wed, 19 Jul 2006 20:17:12 +0800
From:	"Antonino A. Daplas" <adaplas@...il.com>
To:	Panagiotis Issaris <takis@...umba.uhasselt.be>
CC:	linux-kernel@...r.kernel.org, len.brown@...el.com,
	chas@....nrl.navy.mil, miquel@...uba.ar, kkeil@...e.de,
	benh@...nel.crashing.org, video4linux-list@...hat.com,
	rmk+mmc@....linux.org.uk, Neela.Kolli@...enio.com,
	jgarzik@...ox.com, vandrove@...cvut.cz, adaplas@....net,
	thomas@...ischhofer.net, weissg@...nna.at, philb@....org,
	linux-pcmcia@...ts.infradead.org, jkmaline@...hut.fi,
	paulus@...ba.org
Subject: Re: [PATCH] drivers: Conversions from kmalloc+memset to k(z|c)alloc.

Panagiotis Issaris wrote:
> From: Panagiotis Issaris <takis@...aris.org>
> 
> drivers: Conversions from kmalloc+memset to k(z|c)alloc.
> 
> Signed-off-by: Panagiotis Issaris <takis@...aris.org>
> ---
  
> diff --git a/drivers/video/au1100fb.c b/drivers/video/au1100fb.c
> index a92a91f..11f8372 100644
> --- a/drivers/video/au1100fb.c
> +++ b/drivers/video/au1100fb.c
> @@ -453,11 +453,10 @@ int au1100fb_drv_probe(struct device *de
>  			return -EINVAL;
>  
>  	/* Allocate new device private */
> -	if (!(fbdev = kmalloc(sizeof(struct au1100fb_device), GFP_KERNEL))) {
> +	if (!(fbdev = kzalloc(sizeof(struct au1100fb_device), GFP_KERNEL))) {
>  		print_err("fail to allocate device private record");
>  		return -ENOMEM;
>  	}
> -	memset((void*)fbdev, 0, sizeof(struct au1100fb_device));
>  
>  	fbdev->panel = &known_lcd_panels[drv_info.panel_idx];
>  
> @@ -534,10 +533,9 @@ #endif
>  	fbdev->info.fbops = &au1100fb_ops;
>  	fbdev->info.fix = au1100fb_fix;
>  
> -	if (!(fbdev->info.pseudo_palette = kmalloc(sizeof(u32) * 16, GFP_KERNEL))) {
> +	if (!(fbdev->info.pseudo_palette = kzalloc(16, sizeof(u32), GFP_KERNEL))) {

typo? kcalloc?

>  		return -ENOMEM;
>  	}
> -	memset(fbdev->info.pseudo_palette, 0, sizeof(u32) * 16);
>  
>  	if (fb_alloc_cmap(&fbdev->info.cmap, AU1100_LCD_NBR_PALETTE_ENTRIES, 0) < 0) {
>  		print_err("Fail to allocate colormap (%d entries)",
> diff --git a/drivers/video/au1200fb.c b/drivers/video/au1200fb.c
> index c6a5f0c..7d0375a 100644
> --- a/drivers/video/au1200fb.c
> +++ b/drivers/video/au1200fb.c
> @@ -1589,11 +1589,10 @@ static int au1200fb_init_fbinfo(struct a
>  		return -EFAULT;
>  	}
>  
> -	fbi->pseudo_palette = kmalloc(sizeof(u32) * 16, GFP_KERNEL);
> +	fbi->pseudo_palette = kzalloc(16, sizeof(u32), GFP_KERNEL);

here also

The rest of drivers/video looks fine.

Tony
-
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