Re: [PATCH 1/3] arch/powerpc: Add kmalloc NULL tests

2009-08-07 Thread Julia Lawall
From: Julia Lawall Check that the result of kmalloc/kzalloc is not NULL before dereferencing it. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression *x; identifier f; constant char *C; @@ x = \(kmalloc\|kcalloc\|kzalloc\)(...); ... when != x

Re: [PATCH 1/3] arch/powerpc: Add kmalloc NULL tests

2009-08-07 Thread Daniel K.
Julia Lawall wrote: --- a/arch/powerpc/sysdev/fsl_rio.c +++ b/arch/powerpc/sysdev/fsl_rio.c @@ -1057,6 +1057,10 @@ int fsl_rio_setup(struct of_device *dev) law_start, law_size); ops = kmalloc(sizeof(struct rio_ops), GFP_KERNEL); + if (!ops) { + rc

Re: [PATCH 1/3] arch/powerpc: Add kmalloc NULL tests

2009-08-06 Thread Julia Lawall
On Fri, 7 Aug 2009, Daniel K. wrote: > Julia Lawall wrote: > > --- a/arch/powerpc/sysdev/fsl_rio.c > > +++ b/arch/powerpc/sysdev/fsl_rio.c > > @@ -1057,6 +1057,10 @@ int fsl_rio_setup(struct of_device *dev) > > law_start, law_size); > > > > ops = kmalloc(sizeof(struct rio_ops), GFP_KERNE

Re: [PATCH 1/3] arch/powerpc: Add kmalloc NULL tests

2009-08-06 Thread Kumar Gala
On Aug 6, 2009, at 3:04 PM, Julia Lawall wrote: From: Julia Lawall Check that the result of kmalloc/kzalloc is not NULL before dereferencing it. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression *x; identifier f; constant char *C; @@

[PATCH 1/3] arch/powerpc: Add kmalloc NULL tests

2009-08-06 Thread Julia Lawall
From: Julia Lawall Check that the result of kmalloc/kzalloc is not NULL before dereferencing it. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression *x; identifier f; constant char *C; @@ x = \(kmalloc\|kcalloc\|kzalloc\)(...); ... when != x