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: Thu, 8 Mar 2007 23:26:54 -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]>
There is no reason for any subsystem to implement it's own debugging allocator when we have one that works perfectly fine already in SLAB.
So to fix this we should simply remove all of the allocation debugging code here.