Skip to content

Commit 20bdc2c

Browse files
sfrothwellrustyrussell
authored andcommitted
modules: only use mod->param_lock if CONFIG_MODULES
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
1 parent cf2fde7 commit 20bdc2c

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎kernel/params.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@
3030
static DEFINE_MUTEX(param_lock);
3131

3232
/* Use the module's mutex, or if built-in use the built-in mutex */
33+
#ifdef CONFIG_MODULES
3334
#define KPARAM_MUTEX(mod) ((mod) ? &(mod)->param_lock : &param_lock)
35+
#else
36+
#define KPARAM_MUTEX(mod) (&param_lock)
37+
#endif
3438

3539
static inline void check_kparam_locked(struct module *mod)
3640
{

0 commit comments

Comments
 (0)