Skip to contentSkip to conversation

Patch "perf tools: Fix checking asprintf return value" has been added to the 4.5-stable tree

PATCH [email protected] 1 participant 1 message Apr 9, 2016

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

perf tools: Fix checking asprintf return value

to the 4.5-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
perf-tools-fix-checking-asprintf-return-value.patch
and it can be found in the queue-4.5 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 26dee028d365fbc0e3326606a8520260b4462381 Mon Sep 17 00:00:00 2001

From: Wang Nan <[email protected]>
Date: Fri, 19 Feb 2016 11:43:52 +0000
Subject: perf tools: Fix checking asprintf return value

From: Wang Nan <[email protected]>

commit 26dee028d365fbc0e3326606a8520260b4462381 upstream.

According to man pages, asprintf returns -1 when failure. This patch fixes two incorrect return value checker.

Cc Adrian Hunter <[email protected]>
Cc Alexei Starovoitov <[email protected]>
Cc Brendan Gregg <[email protected]>
Cc Cody P Schafer <[email protected]>
Cc He Kuang <[email protected]>
Cc Jeremie Galarneau <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Kirill Smelkov <[email protected]>
Cc Li Zefan <[email protected]>
Cc Masami Hiramatsu <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Zefan Li <[email protected]>
Fixes ffeb883e5662 ("perf tools: Show proper error message for wrong terms of hw/sw events")
---
 tools/perf/util/parse-events.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
tools/perf/util/parse-events.c +3 -3
@@ -2101,11 +2101,11 @@ char *parse_events_formats_error_string(
 
 	/* valid terms */
 	if (additional_terms) {
-		if (!asprintf(&str, "valid terms: %s,%s",
-			      additional_terms, static_terms))
+		if (asprintf(&str, "valid terms: %s,%s",
+			     additional_terms, static_terms) < 0)
 			goto fail;
 	} else {
-		if (!asprintf(&str, "valid terms: %s", static_terms))
+		if (asprintf(&str, "valid terms: %s", static_terms) < 0)
 			goto fail;
 	}
 	return str;

Patches currently in stable-queue which might be from [email protected] are

queue-4.5/perf-tools-fix-checking-asprintf-return-value.patch