diff options
Diffstat (limited to 'drivers/media/video/em28xx/em28xx-video.c')
-rw-r--r-- | drivers/media/video/em28xx/em28xx-video.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c index 6e558d2ca0f3..90aedaeb09b9 100644 --- a/drivers/media/video/em28xx/em28xx-video.c +++ b/drivers/media/video/em28xx/em28xx-video.c | |||
@@ -617,10 +617,8 @@ static void res_free(struct em28xx_fh *fh) | |||
617 | { | 617 | { |
618 | struct em28xx *dev = fh->dev; | 618 | struct em28xx *dev = fh->dev; |
619 | 619 | ||
620 | mutex_lock(&dev->lock); | ||
621 | fh->stream_on = 0; | 620 | fh->stream_on = 0; |
622 | dev->stream_on = 0; | 621 | dev->stream_on = 0; |
623 | mutex_unlock(&dev->lock); | ||
624 | } | 622 | } |
625 | 623 | ||
626 | /* | 624 | /* |
@@ -1282,7 +1280,9 @@ static int vidioc_streamoff(struct file *file, void *priv, | |||
1282 | return -EINVAL; | 1280 | return -EINVAL; |
1283 | 1281 | ||
1284 | videobuf_streamoff(&fh->vb_vidq); | 1282 | videobuf_streamoff(&fh->vb_vidq); |
1283 | mutex_lock(&dev->lock); | ||
1285 | res_free(fh); | 1284 | res_free(fh); |
1285 | mutex_unlock(&dev->lock); | ||
1286 | 1286 | ||
1287 | return 0; | 1287 | return 0; |
1288 | } | 1288 | } |
@@ -1677,11 +1677,10 @@ static int em28xx_v4l2_close(struct inode *inode, struct file *filp) | |||
1677 | em28xx_videodbg("users=%d\n", dev->users); | 1677 | em28xx_videodbg("users=%d\n", dev->users); |
1678 | 1678 | ||
1679 | 1679 | ||
1680 | mutex_lock(&dev->lock); | ||
1680 | if (res_check(fh)) | 1681 | if (res_check(fh)) |
1681 | res_free(fh); | 1682 | res_free(fh); |
1682 | 1683 | ||
1683 | mutex_lock(&dev->lock); | ||
1684 | |||
1685 | if (dev->users == 1) { | 1684 | if (dev->users == 1) { |
1686 | videobuf_stop(&fh->vb_vidq); | 1685 | videobuf_stop(&fh->vb_vidq); |
1687 | videobuf_mmap_free(&fh->vb_vidq); | 1686 | videobuf_mmap_free(&fh->vb_vidq); |