After reading the code I still stand by my previous reply on the same
subject.
The call to the device relese is from __fput, after the use count on the
file is dropped to 0, even if there is still a use count on the dentry
(sound_mmap calls dget) and on the inode.
The device will not have a chance to close itself later, when calling
munmap
or when the exits.
IMHO the only clean solution to the problem is in moving the call to
release
the device/file to dput, or to iput (when dentry or inode use count drop
to 0). It looks like a big change but chances are that it will clean up
some other places as well.
I made a quick look for other places which may suffer from the dsame
problem.
I found only drivers/char/fbmem.c which has both a mmep and release
functions.
But... fbmem is NEVER referenced or used !!!
Itai
-- Itai Nahshon nahshon@actcom.co.il Also nahshon@vnet.ibm.com