Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4d10380e authored by Jan Glauber's avatar Jan Glauber Committed by Rusty Russell
Browse files

module: zero mod->init_ro_size after init is freed.



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: default avatarJan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent 5d05c708
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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);