summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorDavid Smith <dsmith@redhat.com>2009-12-09 10:38:15 -0600
committerDavid Smith <dsmith@redhat.com>2009-12-09 10:38:15 -0600
commit965b658f73ff2a6d11198edc1b84a06a900c1fd7 (patch)
treea03357406dc784eb257c02d20b0100140ab5af03 /runtime
parent3a31e709a19d469c217cc1b65f9f1d6b2ee51ffb (diff)
downloadsystemtap-steved-965b658f73ff2a6d11198edc1b84a06a900c1fd7.tar.gz
systemtap-steved-965b658f73ff2a6d11198edc1b84a06a900c1fd7.tar.xz
systemtap-steved-965b658f73ff2a6d11198edc1b84a06a900c1fd7.zip
PR 10848 partial fix by using systemtap memory functions everywhere.
* runtime/addr-map.c (add_bad_addr_entry): Uses systemtap memory allocation/deallocation wrappers. * runtime/itrace.c (create_itrace_info): Ditto. (remove_usr_itrace_info): Ditto.
Diffstat (limited to 'runtime')
-rw-r--r--runtime/addr-map.c11
-rw-r--r--runtime/itrace.c9
2 files changed, 12 insertions, 8 deletions
diff --git a/runtime/addr-map.c b/runtime/addr-map.c
index 35de7a64..abb723f3 100644
--- a/runtime/addr-map.c
+++ b/runtime/addr-map.c
@@ -163,12 +163,11 @@ add_bad_addr_entry(unsigned long min_addr, unsigned long max_addr,
spin_unlock(&addr_map_lock);
if (new_map)
{
- kfree(new_map);
+ _stp_kfree(new_map);
new_map = 0;
}
- new_map = kmalloc(sizeof(*new_map)
- + sizeof(*new_entry) * (old_size + 1),
- GFP_KERNEL);
+ new_map = _stp_kmalloc(sizeof(*new_map)
+ + sizeof(*new_entry) * (old_size + 1));
if (!new_map)
return -ENOMEM;
new_map->size = old_size + 1;
@@ -191,7 +190,7 @@ add_bad_addr_entry(unsigned long min_addr, unsigned long max_addr,
if (existing_max)
*existing_max = max_entry;
spin_unlock(&addr_map_lock);
- kfree(new_map);
+ _stp_kfree(new_map);
return 1;
}
existing = upper_bound(min_addr, old_map);
@@ -210,7 +209,7 @@ add_bad_addr_entry(unsigned long min_addr, unsigned long max_addr,
blackmap = new_map;
spin_unlock(&addr_map_lock);
if (old_map)
- kfree(old_map);
+ _stp_kfree(old_map);
return 0;
}
diff --git a/runtime/itrace.c b/runtime/itrace.c
index f2ed86f2..5b2437a4 100644
--- a/runtime/itrace.c
+++ b/runtime/itrace.c
@@ -219,7 +219,12 @@ static struct itrace_info *create_itrace_info(
if (debug)
printk(KERN_INFO "create_itrace_info: tid=%d\n", tsk->pid);
/* initialize ui */
- ui = kzalloc(sizeof(struct itrace_info), GFP_USER);
+ ui = _stp_kzalloc(sizeof(struct itrace_info));
+ if (ui == NULL) {
+ printk(KERN_ERR "%s:%d: Unable to allocate memory\n",
+ __FUNCTION__, __LINE__);
+ return NULL;
+ }
ui->tsk = tsk;
ui->tid = tsk->pid;
ui->step_flag = step_flag;
@@ -329,7 +334,7 @@ void static remove_usr_itrace_info(struct itrace_info *ui)
spin_lock(&itrace_lock);
list_del(&ui->link);
spin_unlock(&itrace_lock);
- kfree(ui);
+ _stp_kfree(ui);
}
void static cleanup_usr_itrace(void)