From: Marcus Meissner <meissner@suse.de>
Date: Thu, 15 Jan 2009 21:51:00 +0000 (-0800)
Subject: Documentation/accounting/getdelays.c: fix endless loop
X-Git-Tag: firefly_0821_release~15831
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=65a67bd2644bef225ee318dde76016a4697218fa;p=firefly-linux-kernel-4.4.55.git

Documentation/accounting/getdelays.c: fix endless loop

When no option is passed to getdelays it just hangs, waiting
for a reply which will never come.

This patch prints usage() when no output marker is specified.

Signed-off-by: Marcus Meissner <meissner@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
---

diff --git a/Documentation/accounting/getdelays.c b/Documentation/accounting/getdelays.c
index cc49400b4af8..7ea231172c85 100644
--- a/Documentation/accounting/getdelays.c
+++ b/Documentation/accounting/getdelays.c
@@ -392,6 +392,10 @@ int main(int argc, char *argv[])
 			goto err;
 		}
 	}
+	if (!maskset && !tid && !containerset) {
+		usage();
+		goto err;
+	}
 
 	do {
 		int i;