Skip to content

Commit

Permalink
staging: comedi: comedi_isadma: fix "stalled" detect in comedi_isadma…
Browse files Browse the repository at this point in the history
…_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: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Feb 28, 2015
1 parent c18fafc commit 7e4f1e7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/staging/comedi/drivers/comedi_isadma.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,10 @@ unsigned int comedi_isadma_disable_on_sample(unsigned int dma_chan,
stalled++;
if (stalled > 10)
break;
} else {
residue = new_residue;
stalled = 0;
}
residue = new_residue;
stalled = 0;
}
return residue;
}
Expand Down

0 comments on commit 7e4f1e7

Please sign in to comment.