Staging: Eliminate a NULL pointer dereference
authorJulia Lawall <julia@diku.dk>
Thu, 27 May 2010 12:37:19 +0000 (14:37 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 4 Jun 2010 20:38:57 +0000 (13:38 -0700)
commitc60e55f30a4dac15db51b398c3bd94e4cfbf743a
tree2eb8f149857dc0d52551532b8ebe4f8c8a7db7d3
parent0aa3f139cd5123ffb8f397b91d777635e9761c24
Staging: Eliminate a NULL pointer dereference

Eliminate a NULL or near NULL pointer dereference.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@r exists@
expression E,E1;
identifier f;
statement S1,S2,S3;
@@

if ((E == NULL && ...) || ...)
{
  ... when != if (...) S1 else S2
      when != E = E1
* E->f
  ... when any
  return ...;
}
else S3
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/comedi/drivers/usbdux.c
drivers/staging/dt3155/allocator.c