proc: proc_get_inode() should get module only once
Any file under /proc/net opened more than once leaked the refcounter on the module it belongs to. The problem is that module_get is called for each file opening while module_put is called only when /proc inode is destroyed. So, lets put module counter if we are dealing with already initialised inode. Addresses http://bugzilla.kernel.org/show_bug.cgi?id=10737Signed-off-by: NDenis V. Lunev <den@openvz.org> Cc: David Miller <davem@davemloft.net> Cc: Patrick McHardy <kaber@trash.net> Acked-by: NPavel Emelyanov <xemul@openvz.org> Acked-by: NRobert Olsson <robert.olsson@its.uu.se> Acked-by: NEric W. Biederman <ebiederm@xmission.com> Reported-by: NRoland Kletzing <devzero@web.de> Signed-off-by: NAndrew Morton <akpm@linux-foundation.org> Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
Showing
想要评论请 注册 或 登录