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

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