aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <[email protected]>2007-06-17 17:14:12 -0300
committerMauro Carvalho Chehab <[email protected]>2010-05-18 00:39:28 -0300
commita58d35cb933f21a43fbdb5e4f575ff40faba3df2 (patch)
treeda550b5167d39c0045187cb6c5e7b7adfa841fee
parent2cd4fd1e57cb6897612ead8a3d39ecb444920a1a (diff)
V4L/DVB (12776): tm6000: decrement users count
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
-rw-r--r--drivers/staging/tm6000/tm6000-video.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/staging/tm6000/tm6000-video.c b/drivers/staging/tm6000/tm6000-video.c
index 5697be06ddd7..df3d835ce750 100644
--- a/drivers/staging/tm6000/tm6000-video.c
+++ b/drivers/staging/tm6000/tm6000-video.c
@@ -1441,8 +1441,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);