Skip to content

Commit

Permalink
modules: Fix up build when CONFIG_MODULE_UNLOAD=n.
Browse files Browse the repository at this point in the history
Commit 3d43321 ("modules: sysctl to
block module loading") introduces a modules_disabled variable that is
only defined if CONFIG_MODULE_UNLOAD is enabled, despite being used in
other places. This moves it up and fixes up the build.

  CC      kernel/module.o
kernel/module.c: In function 'sys_init_module':
kernel/module.c:2401: error: 'modules_disabled' undeclared (first use in this function)
kernel/module.c:2401: error: (Each undeclared identifier is reported only once
kernel/module.c:2401: error: for each function it appears in.)
make[1]: *** [kernel/module.o] Error 1
make: *** [kernel/module.o] Error 2

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: James Morris <jmorris@namei.org>
  • Loading branch information
Stephen Rothwell authored and James Morris committed Apr 14, 2009
1 parent ecfcc53 commit 19e4529
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@
static DEFINE_MUTEX(module_mutex);
static LIST_HEAD(modules);

/* Block module loading/unloading? */
int modules_disabled = 0;

/* Waiting for a module to finish initializing? */
static DECLARE_WAIT_QUEUE_HEAD(module_wq);

Expand Down Expand Up @@ -778,9 +781,6 @@ static void wait_for_zero_refcount(struct module *mod)
mutex_lock(&module_mutex);
}

/* Block module loading/unloading? */
int modules_disabled = 0;

SYSCALL_DEFINE2(delete_module, const char __user *, name_user,
unsigned int, flags)
{
Expand Down

0 comments on commit 19e4529

Please sign in to comment.