Staging: comedi: usbdux: release locks on error paths
authorDan Carpenter <error27@gmail.com>
Thu, 30 Jun 2011 09:02:05 +0000 (12:02 +0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 5 Jul 2011 16:24:18 +0000 (09:24 -0700)
Smatch complains about a couple error paths where the semaphores
were not released.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/comedi/drivers/usbdux.c

index 6637698e119ad7b36cfdec275f32322b4f6a9678..bf62e0dd6f696d249dccc14ce04f01a8e0cd7313 100644 (file)
@@ -1465,6 +1465,7 @@ static int usbdux_ao_inttrig(struct comedi_device *dev,
                dev_err(&this_usbduxsub->interface->dev,
                        "comedi%d: usbdux_ao_inttrig: invalid trignum\n",
                        dev->minor);
+               up(&this_usbduxsub->sem);
                return -EINVAL;
        }
        if (!(this_usbduxsub->ao_cmd_running)) {
@@ -2671,6 +2672,7 @@ static int usbdux_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        if (ret < 0) {
                dev_err(&udev->interface->dev,
                        "comedi%d: error alloc space for subdev\n", dev->minor);
+               up(&udev->sem);
                up(&start_stop_sem);
                return ret;
        }