From 734675b473eec85220d1f4d6c324a315cab6193b Mon Sep 17 00:00:00 2001 From: Ian Abbott Date: Wed, 6 Jun 2012 10:48:09 +0100 Subject: [PATCH] ni_labpc: Release spin-lock in labpc_ai_cmd returns an error. There are a couple of places in labpc_ai_cmd() that return without releasing the spin-lock. These places should not be reachable, but release the spin-lock anyway. Spotted by H Hartley Sweeten in the "staging" sources. Signed-off-by: Ian Abbott --- comedi/drivers/ni_labpc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/comedi/drivers/ni_labpc.c b/comedi/drivers/ni_labpc.c index 94764f23..7fd67b9c 100644 --- a/comedi/drivers/ni_labpc.c +++ b/comedi/drivers/ni_labpc.c @@ -1289,6 +1289,7 @@ static int labpc_ai_cmd(comedi_device * dev, comedi_subdevice * s) break; default: comedi_error(dev, "bug with start_src"); + comedi_spin_unlock_irqrestore(&dev->spinlock, flags); return -1; break; } @@ -1301,6 +1302,7 @@ static int labpc_ai_cmd(comedi_device * dev, comedi_subdevice * s) break; default: comedi_error(dev, "bug with stop_src"); + comedi_spin_unlock_irqrestore(&dev->spinlock, flags); return -1; } devpriv->write_byte(devpriv->command2_bits, dev->iobase + COMMAND2_REG); -- 2.26.2