Commit 7e4f1e77 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: comedi_isadma: fix "stalled" detect in comedi_isadma_disable_on_sample()

The "stalled" variable this function is used to detect if the DMA operation
is stalled while trying to disable DMA on a full comedi sample. The reset
of this variable should only occur when the remaining bytes of the DMA
transfer does not equal the remaining bytes from the last check.

Reported-by: coverity (CID 1271132)
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c18fafc8
......@@ -91,10 +91,11 @@ unsigned int comedi_isadma_disable_on_sample(unsigned int dma_chan,
stalled++;
if (stalled > 10)
break;
}
} else {
residue = new_residue;
stalled = 0;
}
}
return residue;
}
EXPORT_SYMBOL_GPL(comedi_isadma_disable_on_sample);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment