lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <51C951BF.1090509@huawei.com>
Date:	Tue, 25 Jun 2013 16:15:59 +0800
From:	"zhangwei(Jovi)" <jovi.zhangwei@...wei.com>
To:	Steven Rostedt <rostedt@...dmis.org>,
	Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>,
	Oleg Nesterov <oleg@...hat.com>
CC:	Frederic Weisbecker <fweisbec@...il.com>,
	Srikar Dronamraju <srikar@...ux.vnet.ibm.com>,
	Ingo Molnar <mingo@...hat.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: [PATCH 1/2] tracing/kprobes: move free_trace_probe into unregister_trace_probe

There have no good reason to call free_trace_probe
every time when unregister_trace_probe return 0.

Move free_trace_probe into unregister_trace_probe,
make code simpler.

Signed-off-by: zhangwei(Jovi) <jovi.zhangwei@...wei.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
Cc: Oleg Nesterov <oleg@...hat.com>
---
 kernel/trace/trace_kprobe.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
index 9f46e98..f193c38 100644
--- a/kernel/trace/trace_kprobe.c
+++ b/kernel/trace/trace_kprobe.c
@@ -401,6 +401,7 @@ static int unregister_trace_probe(struct trace_probe *tp)
 	__unregister_trace_probe(tp);
 	list_del(&tp->list);
 	unregister_probe_event(tp);
+	free_trace_probe(tp);

 	return 0;
 }
@@ -419,7 +420,6 @@ static int register_trace_probe(struct trace_probe *tp)
 		ret = unregister_trace_probe(old_tp);
 		if (ret < 0)
 			goto end;
-		free_trace_probe(old_tp);
 	}

 	/* Register new event */
@@ -550,8 +550,6 @@ static int create_trace_probe(int argc, char **argv)
 		}
 		/* delete an event */
 		ret = unregister_trace_probe(tp);
-		if (ret == 0)
-			free_trace_probe(tp);
 		mutex_unlock(&probe_lock);
 		return ret;
 	}
@@ -680,7 +678,6 @@ static int release_all_trace_probes(void)
 	while (!list_empty(&probe_list)) {
 		tp = list_entry(probe_list.next, struct trace_probe, list);
 		unregister_trace_probe(tp);
-		free_trace_probe(tp);
 	}

 end:
-- 
1.7.9.7


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ