ARM: S3C64XX: DMA: Free node for non-circular queues

We need to free the buff and lli nodes if the buffer queue is
not CIRCULAR.

Signed-off-by: Jassi Brar <jassi.brar@samsung.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
diff --git a/arch/arm/plat-s3c64xx/dma.c b/arch/arm/plat-s3c64xx/dma.c
index 7d12eb8f..d554b93 100644
--- a/arch/arm/plat-s3c64xx/dma.c
+++ b/arch/arm/plat-s3c64xx/dma.c
@@ -610,6 +610,12 @@
 
 		s3c64xx_dma_bufffdone(chan, buff, res);
 
+		/* Free the node and update curr, if non-circular queue */
+		if (!(chan->flags & S3C2410_DMAF_CIRCULAR)) {
+			chan->curr = buff->next;
+			s3c64xx_dma_freebuff(buff);
+		}
+
 		/* Update 'next' */
 		buff = chan->next;
 		if (chan->next == chan->end) {