Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

dynamic debug: move ddebug_remove_module() down into free_module()

The command

echo "file ec.c +p" >/sys/kernel/debug/dynamic_debug/control

causes an oops.

Move the call to ddebug_remove_module() down into free_module(). In this
way it should be called from all error paths. Currently, we are missing
the remove if the module init routine fails.

Signed-off-by: Jason Baron <jbaron@redhat.com>
Reported-by: Thomas Renninger <trenn@suse.de>
Tested-by: Thomas Renninger <trenn@suse.de>
Cc: <stable@kernel.org> [2.6.32+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Jason Baron and committed by
Linus Torvalds
b82bab4b d15aa2cc

+3 -1
+3 -1
kernel/module.c
··· 787 787 788 788 /* Store the name of the last unloaded module for diagnostic purposes */ 789 789 strlcpy(last_unloaded_module, mod->name, sizeof(last_unloaded_module)); 790 - ddebug_remove_module(mod->name); 791 790 792 791 free_module(mod); 793 792 return 0; ··· 1548 1549 remove_notes_attrs(mod); 1549 1550 remove_sect_attrs(mod); 1550 1551 mod_kobject_remove(mod); 1552 + 1553 + /* Remove dynamic debug info */ 1554 + ddebug_remove_module(mod->name); 1551 1555 1552 1556 /* Arch-specific cleanup. */ 1553 1557 module_arch_cleanup(mod);