[Patch 4/4] module: trim exception table in module_free()

Amerigo Wang
2009-05-26T08:36:56Z

Just as the comment said, trim the exception table entries when
module_free() mod->module_init.

Signed-off-by: WANG Cong <amwang@redhat.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>

---
Index: linux-2.6/arch/x86/kernel/module.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/module.c
+++ linux-2.6/arch/x86/kernel/module.c
@@ -64,8 +64,8 @@ void *module_alloc(unsigned long size)
void module_free(struct module *mod, void *module_region)
{
vfree(module_region);
- /* FIXME: If module_region == mod->init_region, trim exception
- table entries. */
+ if (module_region == mod->module_init)
+ mod->num_exentries = 0;
}

/* We don't need anything special. */