From e2eb6d496fd095066e41b6ebdbfda79ca088a914 Mon Sep 17 00:00:00 2001 From: hunt Date: Tue, 9 Jan 2007 17:43:55 +0000 Subject: 2007-01-09 Martin Hunt * symbols.c (_stp_del_module): Fix so memory allocated for module 0 (kernel) is freed. (_stp_free_modules): No need to lock module list. --- runtime/transport/ChangeLog | 6 ++++++ runtime/transport/symbols.c | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'runtime') diff --git a/runtime/transport/ChangeLog b/runtime/transport/ChangeLog index d65c1eee..75197296 100644 --- a/runtime/transport/ChangeLog +++ b/runtime/transport/ChangeLog @@ -1,3 +1,9 @@ +2007-01-09 Martin Hunt + + * symbols.c (_stp_del_module): Fix so memory allocated + for module 0 (kernel) is freed. + (_stp_free_modules): No need to lock module list. + 2006-12-20 Martin Hunt * transport.c: Fixes to use the new 2.6.20 workqueue API. diff --git a/runtime/transport/symbols.c b/runtime/transport/symbols.c index 7381a82e..2aa4897e 100644 --- a/runtime/transport/symbols.c +++ b/runtime/transport/symbols.c @@ -111,7 +111,7 @@ static void _stp_del_module(struct _stp_module *mod) kbug("deleting %s\n", mod->name); /* remove module from the arrays */ - for (num = 1; num < _stp_num_modules; num++) { + for (num = 0; num < _stp_num_modules; num++) { if (_stp_modules[num] == mod) break; } @@ -121,7 +121,7 @@ static void _stp_del_module(struct _stp_module *mod) for (i = num; i < _stp_num_modules-1; i++) _stp_modules[i] = _stp_modules[i+1]; - for (num = 1; num < _stp_num_modules; num++) { + for (num = 0; num < _stp_num_modules; num++) { if (_stp_modules_by_addr[num] == mod) break; } @@ -153,10 +153,10 @@ static void _stp_free_modules(void) int i; unsigned long flags; - STP_LOCK_MODULES; + /* This only happens when the systemtap module unloads */ + /* so there is no need for locks. */ for (i = _stp_num_modules - 1; i >= 0; i--) _stp_del_module(_stp_modules[i]); - STP_UNLOCK_MODULES; } static unsigned long _stp_kallsyms_lookup_name(const char *name); -- cgit