public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf tools: delay_secs safety
@ 2009-10-17 16:08 Tim Blechmann
  2009-10-19  7:56 ` [tip:perf/urgent] perf top: Fix --delay_secs 0 division by zero tip-bot for Tim Blechmann
  0 siblings, 1 reply; 2+ messages in thread
From: Tim Blechmann @ 2009-10-17 16:08 UTC (permalink / raw)
  To: linux-kernel, Peter Zijlstra, Ingo Molnar, Paul Mackerras


[-- Attachment #1.1: Type: text/plain, Size: 228 bytes --]


add delay_secs sanity check to handle_keypress, fixes a division by
zero crash.

Signed-off-by: Tim Blechmann <tim@klingt.org>
---
 tools/perf/builtin-top.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-perf-tools-delay_secs-safety.patch --]
[-- Type: text/x-patch; name="0001-perf-tools-delay_secs-safety.patch", Size: 449 bytes --]

diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 2d8806b..cc66286 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -663,6 +663,8 @@ static void handle_keypress(int c)
 	switch (c) {
 		case 'd':
 			prompt_integer(&delay_secs, "Enter display delay");
+			if (delay_secs < 1)
+				delay_secs = 1;
 			break;
 		case 'e':
 			prompt_integer(&print_entries, "Enter display entries (lines)");


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [tip:perf/urgent] perf top: Fix --delay_secs 0 division by zero
  2009-10-17 16:08 [PATCH] perf tools: delay_secs safety Tim Blechmann
@ 2009-10-19  7:56 ` tip-bot for Tim Blechmann
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Tim Blechmann @ 2009-10-19  7:56 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, acme, paulus, hpa, mingo, a.p.zijlstra, efault,
	fweisbec, tglx, tim, mingo

Commit-ID:  dc79959aaf80e518741657a702fa2727c86c1189
Gitweb:     http://git.kernel.org/tip/dc79959aaf80e518741657a702fa2727c86c1189
Author:     Tim Blechmann <tim@klingt.org>
AuthorDate: Sat, 17 Oct 2009 18:08:29 +0200
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Mon, 19 Oct 2009 09:52:39 +0200

perf top: Fix --delay_secs 0 division by zero

Add delay_secs sanity check to handle_keypress,
this fixes a division by zero crash.

Signed-off-by: Tim Blechmann <tim@klingt.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <4AD9EBFD.106@klingt.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 tools/perf/builtin-top.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 37512e9..a1b1d10 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -686,6 +686,8 @@ static void handle_keypress(int c)
 	switch (c) {
 		case 'd':
 			prompt_integer(&delay_secs, "Enter display delay");
+			if (delay_secs < 1)
+				delay_secs = 1;
 			break;
 		case 'e':
 			prompt_integer(&print_entries, "Enter display entries (lines)");

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-10-19  7:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-17 16:08 [PATCH] perf tools: delay_secs safety Tim Blechmann
2009-10-19  7:56 ` [tip:perf/urgent] perf top: Fix --delay_secs 0 division by zero tip-bot for Tim Blechmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox