]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
ARM: OMAP: Fix omap_set_dma_callback spinlock release
authorTony Lindgren <tony@atomide.com>
Fri, 8 Sep 2006 10:36:54 +0000 (13:36 +0300)
committerTony Lindgren <tony@atomide.com>
Fri, 8 Sep 2006 10:36:54 +0000 (13:36 +0300)
Fix omap_set_dma_callback spinlock release

Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/plat-omap/dma.c

index 422e4f993f0318212edf12b733ec5dcdeda7d4b8..1bbb431843ce056ced668044bd5d71a43036a14e 100644 (file)
@@ -724,9 +724,13 @@ int omap_set_dma_callback(int lch,
 {
        unsigned long flags;
 
+       if (lch < 0)
+               return -ENODEV;
+
        spin_lock_irqsave(&dma_chan_lock, flags);
        if (dma_chan[lch].dev_id == -1) {
                printk(KERN_ERR "DMA callback for not set for free channel\n");
+               spin_unlock_irqrestore(&dma_chan_lock, flags);
                return -EINVAL;
        }
        dma_chan[lch].callback = callback;