Commit 513e48f9 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: ni_labpc: unlock spinlock on command error

When starting the acquisition the labpc_ai_cmd function was
exiting without unlocking the spinlock. This results in a
sparse warning:

warning: context imbalance in 'labpc_ai_cmd' - different lock contexts for basic block

Add the missing spin_unlock_irqrestore calls.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 72fd9fac
......@@ -1386,6 +1386,7 @@ static int labpc_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
break;
default:
comedi_error(dev, "bug with start_src");
spin_unlock_irqrestore(&dev->spinlock, flags);
return -1;
break;
}
......@@ -1398,6 +1399,7 @@ static int labpc_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
break;
default:
comedi_error(dev, "bug with stop_src");
spin_unlock_irqrestore(&dev->spinlock, flags);
return -1;
}
devpriv->write_byte(devpriv->command2_bits, dev->iobase + COMMAND2_REG);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment