From: Rusty Russell Since 2.6.4 we've been ignoring the failure of try_stop_module: it will normally fail if the module reference count is non-zero. This would have been mainly unnoticed, since "modprobe -r" checks the usage count before calling sys_delete_module(), however there is a race which would cause a hang in this case. Signed-off-by: Rusty Russell Signed-off-by: Andrew Morton --- 25-akpm/kernel/module.c | 2 ++ 1 files changed, 2 insertions(+) diff -puN kernel/module.c~dont-ignore-try_stop_module-return kernel/module.c --- 25/kernel/module.c~dont-ignore-try_stop_module-return Wed Nov 3 14:06:04 2004 +++ 25-akpm/kernel/module.c Wed Nov 3 14:06:04 2004 @@ -576,6 +576,8 @@ sys_delete_module(const char __user *nam /* Stop the machine so refcounts can't move and disable module. */ ret = try_stop_module(mod, flags, &forced); + if (ret != 0) + goto out; /* Never wait if forced. */ if (!forced && module_refcount(mod) != 0) _