diff options
Diffstat (limited to 'lib/dynamic_debug.c')
-rw-r--r-- | lib/dynamic_debug.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index dbf2b457e47e..8274c4ea75e0 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c | |||
@@ -847,17 +847,17 @@ int ddebug_add_module(struct _ddebug *tab, unsigned int n, | |||
847 | const char *name) | 847 | const char *name) |
848 | { | 848 | { |
849 | struct ddebug_table *dt; | 849 | struct ddebug_table *dt; |
850 | const char *new_name; | ||
851 | 850 | ||
852 | dt = kzalloc(sizeof(*dt), GFP_KERNEL); | 851 | dt = kzalloc(sizeof(*dt), GFP_KERNEL); |
853 | if (dt == NULL) | 852 | if (dt == NULL) |
854 | return -ENOMEM; | 853 | return -ENOMEM; |
855 | new_name = kstrdup_const(name, GFP_KERNEL); | 854 | /* |
856 | if (new_name == NULL) { | 855 | * For built-in modules, name lives in .rodata and is |
857 | kfree(dt); | 856 | * immortal. For loaded modules, name points at the name[] |
858 | return -ENOMEM; | 857 | * member of struct module, which lives at least as long as |
859 | } | 858 | * this struct ddebug_table. |
860 | dt->mod_name = new_name; | 859 | */ |
860 | dt->mod_name = name; | ||
861 | dt->num_ddebugs = n; | 861 | dt->num_ddebugs = n; |
862 | dt->ddebugs = tab; | 862 | dt->ddebugs = tab; |
863 | 863 | ||
@@ -913,7 +913,6 @@ int ddebug_dyndbg_module_param_cb(char *param, char *val, const char *module) | |||
913 | static void ddebug_table_free(struct ddebug_table *dt) | 913 | static void ddebug_table_free(struct ddebug_table *dt) |
914 | { | 914 | { |
915 | list_del_init(&dt->link); | 915 | list_del_init(&dt->link); |
916 | kfree_const(dt->mod_name); | ||
917 | kfree(dt); | 916 | kfree(dt); |
918 | } | 917 | } |
919 | 918 | ||