Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d667522f authored by Russell King's avatar Russell King Committed by Russell King
Browse files

[ARM] dma: ensure that the single entry sg is properly initialized

parent 8c56afcb
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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;