Fix mmap_count.
authorIan Abbott <abbotti@mev.co.uk>
Tue, 1 Nov 2011 09:43:56 +0000 (09:43 +0000)
committerIan Abbott <abbotti@mev.co.uk>
Tue, 1 Nov 2011 09:43:56 +0000 (09:43 +0000)
commit90531c2a26c4e9d8df0ebb21430988b9393006f4
tree2615f50c319148ae1577c5ab3de8a8e321f74241
parentc7df654b722600ff3c8d77682806729370c7dc5b
Fix mmap_count.

Follow bug-fix by Federico Vaga in Linux "staging" version:

In comedi_fops, mmap_count is decremented at comedi_vm_ops->close but it
is not incremented at comedi_vm_ops->open. This may result in a negative
counter.  The patch introduces the open method to keep the counter
consistent.

The bug was triggerd by this sample code:

        mmap(0, ...., comedi_fd);
        fork();
        exit(0);
comedi/comedi_fops.c