From: Dan Carpenter Date: Thu, 30 Jun 2011 09:02:05 +0000 (+0300) Subject: Staging: comedi: usbdux: release locks on error paths X-Git-Tag: MMI-PSA29.97-13-9~18845^2~368 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=85678d5d27cb0ea1005316f51b1b062bf4609b66;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git Staging: comedi: usbdux: release locks on error paths Smatch complains about a couple error paths where the semaphores were not released. Signed-off-by: Dan Carpenter Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/usbdux.c b/drivers/staging/comedi/drivers/usbdux.c index 6637698e119a..bf62e0dd6f69 100644 --- a/drivers/staging/comedi/drivers/usbdux.c +++ b/drivers/staging/comedi/drivers/usbdux.c @@ -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; }