[ARM] dma: ensure that the single entry sg is properly initialized
authorRussell King <rmk@dyn-67.arm.linux.org.uk>
Mon, 8 Dec 2008 17:50:25 +0000 (17:50 +0000)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Thu, 11 Dec 2008 14:52:42 +0000 (14:52 +0000)
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/kernel/dma.c

index aab24f03ea14ac6d00ead993aea6ac2e830862fa..e7828fcd9544d4ac05eaca20af114fb990ae76a9 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/init.h>
 #include <linux/spinlock.h>
 #include <linux/errno.h>
+#include <linux/scatterlist.h>
 
 #include <asm/dma.h>
 
@@ -37,6 +38,9 @@ int __init isa_dma_add(unsigned int chan, dma_t *dma)
 {
        if (!dma->d_ops)
                return -EINVAL;
+
+       sg_init_table(&dma->buf, 1);
+
        if (dma_chan[chan])
                return -EBUSY;
        dma_chan[chan] = dma;