]> bbs.cooldavid.org Git - net-next-2.6.git/commit
drivers/dma: Eliminate a NULL pointer dereference
authorJulia Lawall <julia@diku.dk>
Thu, 27 May 2010 12:33:17 +0000 (14:33 +0200)
committerDan Williams <dan.j.williams@intel.com>
Thu, 1 Jul 2010 09:27:35 +0000 (02:27 -0700)
commit485680050166dc8c6ac976346430ab1f453c228b
treeee1400398cb1f88dcb975715e16dfa525db9cecf
parentefcc28981745bc6aca88acb2d4d37d87f090a80a
drivers/dma: Eliminate a NULL pointer dereference

If td_desc is NULL, just skip both kfrees.

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: Dan Williams <dan.j.williams@intel.com>
drivers/dma/timb_dma.c