On Sat, Jul 19, 2008 at 11:16:58PM +0530, nagaraj s k wrote:
> @@ -69,7 +69,7 @@ void *drm_realloc(void *oldpt, size_t ol
> {
> void *pt;
>
> - if (!(pt = kmalloc(size, GFP_KERNEL)))
> + if (!(pt == kmalloc(size, GFP_KERNEL)))
> return NULL;
> if (oldpt && oldsize) {
> memcpy(pt, oldpt, oldsize);
Er, this is absolutely not an error. You'll note that pt is
uninitialised, and the odds of a specific piece of uninitialised memory
pointing to exactly the location kmalloc returns are ... rather low.
It could be rewritten for clarity as:
pt = kmalloc(size, GFP_KERNEL);
if (!pt)
return NULL;
But your patch means the function can practically never actually work.
Cheers,
Daniel
signature.asc
Description: Digital signature
------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/
-- _______________________________________________ Dri-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/dri-devel
