drivers/dma: Correct NULL test
authorJulia Lawall <julia@diku.dk>
Sat, 6 Feb 2010 08:43:41 +0000 (09:43 +0100)
committerDan Williams <dan.j.williams@intel.com>
Wed, 10 Feb 2010 19:07:28 +0000 (12:07 -0700)
commit734c2992828c66cee3feb21ecd30a6ac44aecc51
treec732007f463393046dc83cc3d6b5953cb076aa32
parent8f98781e0f15207b6ab33bee1fae05428be0475b
drivers/dma: Correct NULL test

cohd_fin has already been verified not to be NULL, so the argument to
BUG_ON cannot be true.

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

// <smpl>
@r@
expression *x;
expression e;
identifier l;
@@

if (x == NULL || ...) {
    ... when forall
    return ...; }
... when != goto l;
    when != x = e
    when != &x
*x == NULL
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/dma/coh901318.c