Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 734c2992 authored by Julia Lawall's avatar Julia Lawall Committed by Dan Williams
Browse files

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: default avatarJulia Lawall <julia@diku.dk>
Acked-by: default avatarLinus Walleij <linus.walleij@stericsson.com>
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent 8f98781e
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -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;