From 34b6750a5f1a8249b59e49e002f04767be1ec364 Mon Sep 17 00:00:00 2001 From: Tony Lindgren Date: Fri, 8 Sep 2006 13:36:54 +0300 Subject: [PATCH] ARM: OMAP: Fix omap_set_dma_callback spinlock release Fix omap_set_dma_callback spinlock release Signed-off-by: Tony Lindgren --- arch/arm/plat-omap/dma.c | 4 ++++ 1 file changed, 4 insertions(+) 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; -- 2.41.1