summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--runtime/transport/ChangeLog6
-rw-r--r--runtime/transport/symbols.c8
2 files changed, 10 insertions, 4 deletions
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 <hunt@redhat.com>
+
+ * 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 <hunt@redhat.com>
* 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);