Skip to content

Commit

Permalink
module: zero mod->init_ro_size after init is freed.
Browse files Browse the repository at this point in the history
Reset mod->init_ro_size to zero after the init part of a module is unloaded.
Otherwise we need to check if module->init is NULL in the unprotect functions
in the next patch.

Signed-off-by: Jan Glauber <[email protected]>
Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
Jan Glauber authored and rustyrussell committed May 19, 2011
1 parent 5d05c70 commit 4d10380
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -2935,6 +2935,7 @@ SYSCALL_DEFINE3(init_module, void __user *, umod,
module_free(mod, mod->module_init);
mod->module_init = NULL;
mod->init_size = 0;
mod->init_ro_size = 0;
mod->init_text_size = 0;
mutex_unlock(&module_mutex);

Expand Down

0 comments on commit 4d10380

Please sign in to comment.