amplc_pci230: Fix dangling spin-lock
authorIan Abbott <abbotti@mev.co.uk>
Fri, 8 Jun 2012 09:26:06 +0000 (10:26 +0100)
committerIan Abbott <abbotti@mev.co.uk>
Fri, 8 Jun 2012 09:26:06 +0000 (10:26 +0100)
pci230_ao_inttrig_scan_begin() could return without releasing a
spin-lock.  Fix it.

Spotted by Dan Carpenter in the "staging" sources.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
comedi/drivers/amplc_pci230.c

index e1ea2b495f74f66f207256a13becad061011e515..fdbead33ac969041ec98bf1811910e6cd72fcba4 100644 (file)
@@ -1443,6 +1443,9 @@ static int pci230_ao_inttrig_scan_begin(comedi_device * dev,
                /* Delay.  Should driver be responsible for this? */
                /* XXX TODO: See if DAC busy bit can be used. */
                comedi_udelay(8);
+       } else {
+               comedi_spin_unlock_irqrestore(&devpriv-> ao_stop_spinlock,
+                       irqflags);
        }
 
        return 1;