net/wanrouter/wanmain.c: check kmalloc() return value.
PATCH 1/1 net/wanrouter/wanmain.c: check kmalloc() return value.
Description: Check the return value of kmalloc() in function dbg_kmalloc(), in file net/wanrouter/wanmain.c.
Signed-off-by Amit Choudhary <[email protected]>
net/wanrouter/wanmain.c +2 -0
@@ -67,6 +67,8 @@ static void * dbg_kmalloc(unsigned int sint i =0 ;void * v =kmalloc (size+sizeof (unsigned int )+2 *KMEM_SAFETYZONE *8 ,prio);char * c1 = v; +if (!v) +return NULL ; c1 +=sizeof (unsigned int ); *((unsigned int *)v) = size;
David Miller
maintainerFrom: Amit Choudhary <[email protected]>
Date: Wed, 6 Dec 2006 23:04:58 -0800
Quoted 3 lines
Description: Check the return value of
kmalloc()in functiondbg_kmalloc(), in filenet/wanrouter/wanmain.c.Signed-off-by Amit Choudhary <[email protected]>
Better to just delete this code altogether, there is no need for any subsystem to duplicate the already implemented SLAB debugging functionality.
And that's how I'll fix this, thanks for pointing out the problem :)