pwc: unlock on error in pwc_ioctl()
Subsystems (2)
PATCH 1/1 pwc: unlock on error in pwc_ioctl()
In 82dfdada40 "pwc: rework locking" we changed the locking so that we handle it ourselves instead of doing it at the vl42 layer. There were a couple ioctls, VIDIOCPWCSLED and VIDIOCPWCGLED, where we didn't unlock on the error path.
Signed-off-by Dan Carpenter <[email protected]>
drivers/media/video/pwc/pwc-ctrl.c +6 -3
@@ -840,13 +840,15 @@ long pwc_ioctl(struct pwc_device *pdev, unsigned int cmd, void *arg)mutex_lock (&pdev->udevlock);if (!pdev->udev) { +mutex_unlock (&pdev->udevlock); ret = -ENODEV ; - goto leave; +break ; }if (pdev->iso_init) { +mutex_unlock (&pdev->udevlock); ret = -EBUSY ; - goto leave; +break ; }ARG_IN (qual)
@@ -854,7 +856,6 @@ long pwc_ioctl(struct pwc_device *pdev, unsigned int cmd, void *arg) ret = -EINVAL ; else ret =pwc_set_video_mode (pdev, pdev->view.x, pdev->view.y, pdev->vframes,ARGR (qual), pdev->vsnapshot); -leave:mutex_unlock (&pdev->udevlock);break ; }
@@ -978,6 +979,7 @@ leave:mutex_lock (&pdev->udevlock);if (!pdev->udev) { +mutex_unlock (&pdev->udevlock); ret = -ENODEV ;break ; }
@@ -996,6 +998,7 @@ leave:mutex_lock (&pdev->udevlock);if (!pdev->udev) { +mutex_unlock (&pdev->udevlock); ret = -ENODEV ;break ; }