diff options
| author | Rusty Russell <rusty@rustcorp.com.au> | 2004-11-07 04:05:54 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-11-07 04:05:54 -0800 |
| commit | 2170e4ac47d3d24697f132995b8db9543f69f161 (patch) | |
| tree | 3d142d9d5ccd2019bb41c42486bd66c73e6b06e4 /kernel | |
| parent | 1cb2c359085dd19225cc7030d3204fc19a55dac0 (diff) | |
[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: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/module.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/module.c b/kernel/module.c index 07cb91d8f761..0798443ce002 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -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) |
