From: Tony Lindgren Date: Fri, 8 Sep 2006 10:36:54 +0000 (+0300) Subject: ARM: OMAP: Fix omap_set_dma_callback spinlock release X-Git-Tag: v2.6.18-omap1~78 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=34b6750a5f1a8249b59e49e002f04767be1ec364;p=linux-2.6-omap-h63xx.git ARM: OMAP: Fix omap_set_dma_callback spinlock release Fix omap_set_dma_callback spinlock release Signed-off-by: Tony Lindgren --- diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c index 422e4f993f0..1bbb431843c 100644 --- a/arch/arm/plat-omap/dma.c +++ b/arch/arm/plat-omap/dma.c @@ -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;