From a58d35cb933f21a43fbdb5e4f575ff40faba3df2 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sun, 17 Jun 2007 17:14:12 -0300 Subject: [PATCH] V4L/DVB (12776): tm6000: decrement users count Signed-off-by: Mauro Carvalho Chehab --- drivers/staging/tm6000/tm6000-video.c | 8 ++++++-- 1 file 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); -- 2.30.2