The calculation for the total number of bytes in the DMA transfer
is incorrect. Fix it.

Signed-off-by: H Hartley Sweeten <hswee...@visionengravers.com>
Cc: Ian Abbott <abbo...@mev.co.uk>
Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org>
---
 drivers/staging/comedi/drivers/pcl816.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/comedi/drivers/pcl816.c 
b/drivers/staging/comedi/drivers/pcl816.c
index 3742f5f..9c1b963 100644
--- a/drivers/staging/comedi/drivers/pcl816.c
+++ b/drivers/staging/comedi/drivers/pcl816.c
@@ -164,9 +164,7 @@ static void pcl816_ai_setup_dma(struct comedi_device *dev,
        bytes = devpriv->hwdmasize;
        if (cmd->stop_src == TRIG_COUNT) {
                /*  how many */
-               bytes = s->async->cmd.chanlist_len *
-               s->async->cmd.chanlist_len *
-               sizeof(short);
+               bytes = cmd->stop_arg * cmd->chanlist_len * sizeof(short);
 
                /*  how many DMA pages we must fill */
                devpriv->dma_runs_to_end = bytes / devpriv->hwdmasize;
-- 
1.9.2

_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to