From: Mauro Carvalho Chehab Date: Sat, 10 Nov 2007 13:26:20 +0000 (-0300) Subject: V4L/DVB (6581): Fix: avoids negative vma usage count X-Git-Tag: v2.6.24-rc6~97 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=63337dd3f5506628e4831b08e39e09d7f1407769;p=linux-2.6 V4L/DVB (6581): Fix: avoids negative vma usage count Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c index d3dd6a0fc8..0906bc5766 100644 --- a/drivers/media/video/em28xx/em28xx-video.c +++ b/drivers/media/video/em28xx/em28xx-video.c @@ -571,7 +571,9 @@ static void em28xx_vm_close(struct vm_area_struct *vma) { /* NOTE: buffers are not freed here */ struct em28xx_frame_t *f = vma->vm_private_data; - f->vma_use_count--; + + if (f->vma_use_count) + f->vma_use_count--; } static struct vm_operations_struct em28xx_vm_ops = {