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

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Jesper Juhl <jesper.juhl@...>
Cc: Robert P. J. Day <rpjday@...>, Denys Vlasenko <vda.linux@...>, <linux-mtd@...>, David Woodhouse <dwmw2@...>, Linux Kernel Mailing List <linux-kernel@...>
Date: Saturday, August 25, 2007 - 9:52 pm

On Aug 25, 2007, at 20:36:32, Jesper Juhl wrote:

I think the original reasoning behind kcalloc() was that it did some  
extra input checking, so that if the product of the two numbers  
overflowed, it would fail with NULL instead of allocating  
insufficient space.  In the kernel it doesn't matter in practice  
since you MUST have additional checking on the size of allocated  
memory anyways, not even considering the fact that >PAGE_SIZE  
allocations are probably going to fail with decent frequency regardless.

Cheers,
Kyle Moffett


-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH 09/30] mtd: Don't cast kmalloc() return value in ..., Kyle Moffett, (Sat Aug 25, 9:52 pm)