summaryrefslogtreecommitdiffstats
path: root/runtime/transport/procfs.c
diff options
context:
space:
mode:
authorfche <fche>2007-03-12 17:15:30 +0000
committerfche <fche>2007-03-12 17:15:30 +0000
commitcb43d90b37a7f9a066d56881b87067ef3254d95d (patch)
treebe93238d792dee6c1c1bf0f02a397cb8e48e984b /runtime/transport/procfs.c
parent9b2f2790c0656bfa7cb7e1b4c09391a9e751d079 (diff)
downloadsystemtap-steved-cb43d90b37a7f9a066d56881b87067ef3254d95d.tar.gz
systemtap-steved-cb43d90b37a7f9a066d56881b87067ef3254d95d.tar.xz
systemtap-steved-cb43d90b37a7f9a066d56881b87067ef3254d95d.zip
2007-03-12 Frank Ch. Eigler <fche@redhat.com>
PR 4179. Based on patch from Vasily Averin <vvs@sw.ru>: * time.c (_stp_init_time): Recover from partial failures. 2007-03-12 Frank Ch. Eigler <fche@redhat.com> PR 4179. Based on patch from Vasily Averin <vvs@sw.ru>: * procfs.c (_stp_register_procfs): Recover from partial failures. * transport.c (_stp_transport_open): Ditto.
Diffstat (limited to 'runtime/transport/procfs.c')
-rw-r--r--runtime/transport/procfs.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/runtime/transport/procfs.c b/runtime/transport/procfs.c
index 136c6d06..ca243035 100644
--- a/runtime/transport/procfs.c
+++ b/runtime/transport/procfs.c
@@ -1,7 +1,7 @@
/* -*- linux-c -*-
*
* /proc transport and control
- * Copyright (C) 2005, 2006, 2007 Red Hat Inc.
+ * Copyright (C) 2005-2007 Red Hat Inc.
*
* This file is part of systemtap, and is free software. You can
* redistribute it and/or modify it under the terms of the GNU General
@@ -318,7 +318,7 @@ static int _stp_register_procfs (void)
p = (struct list_head *)kmalloc(sizeof(struct _stp_buffer),STP_ALLOC_FLAGS);
// printk("allocated buffer at %lx\n", (long)p);
if (!p)
- goto err2;
+ goto err0;
_stp_allocated_net_memory += sizeof(struct _stp_buffer);
list_add (p, &_stp_pool_q);
}
@@ -368,12 +368,6 @@ static int _stp_register_procfs (void)
de->proc_fops = &_stp_proc_fops_cmd;
return 0;
-err2:
- list_for_each_safe(p, tmp, &_stp_pool_q) {
- list_del(p);
- kfree(p);
- }
-
err1:
#ifdef STP_RELAYFS
for (de = _stp_proc_mod->subdir; de; de = de->next)
@@ -388,6 +382,11 @@ err1:
#endif
remove_proc_entry (THIS_MODULE->name, _stp_proc_root);
err0:
+ list_for_each_safe(p, tmp, &_stp_pool_q) {
+ list_del(p);
+ kfree(p);
+ }
+
printk (KERN_ERR "Error creating systemtap /proc entries.\n");
return -1;
}
@@ -410,7 +409,7 @@ static void _stp_unregister_procfs (void)
}
#endif
remove_proc_entry ("cmd", _stp_proc_mod);
- remove_proc_entry (THIS_MODULE->name, _stp_proc_root);
+ remove_proc_entry (THIS_MODULE->name, _stp_proc_root); /* XXX: race condition */
/* free memory pools */
list_for_each_safe(p, tmp, &_stp_pool_q) {