]> git.baikalelectronics.ru Git - kernel.git/commit
PCI hotplug: ibmphp: Fix module ref count underflow
authorNeil Horman <nhorman@tuxdriver.com>
Thu, 18 Dec 2008 00:07:47 +0000 (16:07 -0800)
committerJesse Barnes <jbarnes@virtuousgeek.org>
Thu, 18 Dec 2008 00:07:47 +0000 (16:07 -0800)
commit7e8cdfd6648db6c9b860eabeb7423c3f06b3dcfb
treec9aa0988205a5879b7a9d7b8cb2972c45636e719
parent1a6fe2e650c74bf3ef175a4f07646d9866bb124e
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: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
drivers/pci/hotplug/ibmphp_core.c