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

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

comedi/drivers/usbdux.c

index 032877a69c1175ad23c31a37afd173a36c8b1c1c..133997110646cbf856923b157a09cf789759baff 100644 (file)
@@ -1437,6 +1437,7 @@ static int usbdux_ao_inttrig(comedi_device * dev, comedi_subdevice * s,
        if (trignum != 0) {
                printk("comedi%d: usbdux_ao_inttrig: invalid trignum\n",
                        dev->minor);
+               mutex_unlock(&this_usbduxsub->mutex);
                return -EINVAL;
        }
        if (!(this_usbduxsub->ao_cmd_running)) {