usbduxsigma: unlock on error in usbdux_ao_inttrig()
authorIan Abbott <abbotti@mev.co.uk>
Wed, 30 Nov 2011 14:55:06 +0000 (14:55 +0000)
committerIan Abbott <abbotti@mev.co.uk>
Wed, 30 Nov 2011 14:55:06 +0000 (14:55 +0000)
Follow patch by Dan Carpenter to the "staging" sources.

When trignum is invalid it returned without unlocking the mutex.
Fix it.

comedi/drivers/usbduxsigma.c

index e42d6ec98b5cf5fb12e3f0e89bfb68ba8689ab67..3596c1e5dc6c4e5666d79cd9e4c9e3dc0124d6d5 100644 (file)
@@ -1535,6 +1535,7 @@ static int usbdux_ao_inttrig(comedi_device *dev,
                dev_err(&this_usbduxsub->interface->dev,
                        "comedi%d: usbdux_ao_inttrig: invalid trignum\n",
                        dev->minor);
+               mutex_unlock(&this_usbduxsub->sem);
                return -EINVAL;
        }
        if (!(this_usbduxsub->ao_cmd_running)) {