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

From: Amerigo Wang
Date: Tue May 26 2009 - 04:37:00 EST



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

Signed-off-by: WANG Cong <amwang@xxxxxxxxxx>
Cc: Rusty Russell <rusty@xxxxxxxxxxxxxxx>

---
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. */
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/