Commit 2170e4ac authored by Rusty Russell's avatar Rusty Russell Committed by Linus Torvalds

[PATCH] Don't ignore try_stop_module return

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: default avatarRusty Russell <rusty@rustcorp.com.au>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 1cb2c359
......@@ -576,6 +576,8 @@ sys_delete_module(const char __user *name_user, unsigned int flags)
/* 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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment