mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/1] kfifo: fix DMA sample driver
@ 2010-08-13 18:32 Ira W. Snyder
  2010-08-13 18:34 ` Ira W. Snyder
  0 siblings, 1 reply; 2+ messages in thread
From: Ira W. Snyder @ 2010-08-13 18:32 UTC (permalink / raw)
  To: linux-kernel

The kfifo DMA sample driver is broken. It does not properly initialize
the scatterlist, and therefore causes a kernel BUG with
CONFIG_DEBUG_SG=y.

Signed-off-by: Ira W. Snyder <iws@ovro.caltech.edu>
---
 samples/kfifo/dma-example.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/samples/kfifo/dma-example.c b/samples/kfifo/dma-example.c
index b9482c2..baa5060 100644
--- a/samples/kfifo/dma-example.c
+++ b/samples/kfifo/dma-example.c
@@ -45,6 +45,9 @@ static int __init example_init(void)
 
 	printk(KERN_INFO "queue len: %u\n", kfifo_len(&fifo));
 
+	/* initialize scatterlist */
+	sg_init_table(sg, ARRAY_SIZE(sg));
+
 	ret = kfifo_dma_in_prepare(&fifo, sg, ARRAY_SIZE(sg), FIFO_SIZE);
 	printk(KERN_INFO "DMA sgl entries: %d\n", ret);
 
-- 
1.7.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-08-13 18:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-13 18:32 [PATCH 1/1] kfifo: fix DMA sample driver Ira W. Snyder
2010-08-13 18:34 ` Ira W. Snyder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®