[PATCH 1/4] mtd: Don't cast kmalloc() return value in drivers/mtd/maps/pmcmsp-flash.c

Robert P. J. Day rpjday at mindspring.com
Sun Aug 26 04:36:33 EDT 2007


On Sun, 26 Aug 2007, Jesper Juhl wrote:

> +	msp_maps = kmalloc(fcnt * sizeof(struct mtd_info), GFP_KERNEL);
>  	memset(msp_maps, 0, fcnt * sizeof(struct mtd_info));

...

> +		msp_parts[i] = kmalloc(pcnt * sizeof(struct mtd_partition),
> +			GFP_KERNEL);
>  		memset(msp_parts[i], 0, pcnt * sizeof(struct mtd_partition));

again, both of the above could be done with a single call to kcalloc()
in each case.  why are you so philosophically opposed to doing it that
way?

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

http://crashcourse.ca
========================================================================



More information about the linux-mtd mailing list