Skip to contentSkip to conversation

tools lib traceevent: test correct variable after allocation

PATCH In review Sasha Levin 2 participants 3 messages Dec 21, 2012 – Jan 25, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools lib traceevent: test correct variable after allocation

we've tested the wrong variable for allocation failure, fix it to test the right one.

---
 tools/lib/traceevent/event-parse.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/lib/traceevent/event-parse.c +1 -1
index 5a824e3..7538a1f 100644
@@ -2481,7 +2481,7 @@ process_dynamic_array(struct event_format *event, struct print_arg *arg, char **
 
 	free_token(token);
 	arg = alloc_arg();
-	if (!field) {
+	if (!arg) {
 		do_warning("%s: not enough memory!", __func__);
 		*tok = NULL;
 		return EVENT_ERROR;
Signature · 1 line
1.8.0
#2 lore raw
In reply to Sasha Levin
Commit-ID:  fba7a78220fd969beeaa9abbb97c5f7027a7b4fd
Gitweb:     http://git.kernel.org/tip/fba7a78220fd969beeaa9abbb97c5f7027a7b4fd
Author:     Sasha Levin <[email protected]>
AuthorDate: Fri, 21 Dec 2012 15:00:58 -0500
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Thu, 24 Jan 2013 16:40:16 -0300

tools lib traceevent: test correct variable after allocation

we've tested the wrong variable for allocation failure, fix it to test the right one.

---
 tools/lib/traceevent/event-parse.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/lib/traceevent/event-parse.c +1 -1
index 5a824e3..7538a1f 100644
@@ -2481,7 +2481,7 @@ process_dynamic_array(struct event_format *event, struct print_arg *arg, char **
 
 	free_token(token);
 	arg = alloc_arg();
-	if (!field) {
+	if (!arg) {
 		do_warning("%s: not enough memory!", __func__);
 		*tok = NULL;
 		return EVENT_ERROR;