diff options
Diffstat (limited to 'linux')
-rw-r--r-- | linux/drivers/staging/tm6000/tm6000-video.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/linux/drivers/staging/tm6000/tm6000-video.c b/linux/drivers/staging/tm6000/tm6000-video.c index a67bcf7df..e167e973b 100644 --- a/linux/drivers/staging/tm6000/tm6000-video.c +++ b/linux/drivers/staging/tm6000/tm6000-video.c @@ -1502,8 +1502,12 @@ static int tm6000_release(struct inode *inode, struct file *file) dprintk(dev, V4L2_DEBUG_OPEN, "tm6000: close called (minor=%d, users=%d)\n",minor,dev->users); - tm6000_stop_thread(vidq); - videobuf_mmap_free(&fh->vb_vidq); + dev->users--; + + if (!dev->users) { + tm6000_stop_thread(vidq); + videobuf_mmap_free(&fh->vb_vidq); + } kfree (fh); |