From: Federico Vaga Date: Sat, 29 Oct 2011 07:45:39 +0000 (+0200) Subject: Staging: comedi: fix mmap_count X-Git-Tag: v3.2-rc5~51^2~4 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=df30b21cb0eed5ba8a8e0cdfeebc66ba8cde821d;p=pandora-kernel.git Staging: comedi: fix mmap_count 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); Acked-by: Alessandro Rubini Signed-off-by: Federico Vaga Cc: stable Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed