Skip to content

Commit

Permalink
drivers/dma: Correct NULL test
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Julia Lawall authored and Dan Williams committed Feb 10, 2010
1 parent 8f98781 commit 734c299
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions drivers/dma/coh901318.c
Original file line number Diff line number Diff line change
Expand Up @@ -613,8 +613,6 @@ static void dma_tasklet(unsigned long data)
cohd_fin->pending_irqs--;
cohc->completed = cohd_fin->desc.cookie;

BUG_ON(cohc->nbr_active_done && cohd_fin == NULL);

if (cohc->nbr_active_done == 0)
return;

Expand Down

0 comments on commit 734c299

Please sign in to comment.