aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorH Hartley Sweeten <hsweeten@visionengravers.com>2015-02-23 13:22:44 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-02-28 07:20:37 -0800
commit7e4f1e777814c6916b513b5dc90e030ee4e25f04 (patch)
tree1c074688e0e653fad3324aaceb34266db7c89731 /drivers/staging
parentMerge tag 'iio-fixes-for-4.0b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-linus (diff)
downloadlinux-dev-7e4f1e777814c6916b513b5dc90e030ee4e25f04.tar.xz
linux-dev-7e4f1e777814c6916b513b5dc90e030ee4e25f04.zip
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: 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>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/comedi/drivers/comedi_isadma.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/staging/comedi/drivers/comedi_isadma.c b/drivers/staging/comedi/drivers/comedi_isadma.c
index dbdea71d6b95..e856f01ca077 100644
--- a/drivers/staging/comedi/drivers/comedi_isadma.c
+++ b/drivers/staging/comedi/drivers/comedi_isadma.c
@@ -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;
}