PCI hotplug: ibmphp: Fix module ref count underflow
I happened to notice that the ibmphp hotplug driver does something rather silly in its init routine. It purposely calls module_put so as to underflow its module ref count to avoid being removed from the kernel. This is bad practice, and wrong, since it provides a window for subsequent module_gets to reset the refcount to zero, allowing an unload to race in and cause all sorts of mysterious panics. If the module is unsafe to load, simply omitting the module_exit parameter is sufficient to prevent the kernel from allowing the unload. Acked-by: NGreg Kroah-Hartman <gregkh@suse.de> Signed-off-by: NNeil Horman <nhorman@tuxdriver.com> Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
Showing
想要评论请 注册 或 登录