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
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
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
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;
@@
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