diff options
| -rw-r--r-- | tools/perf/util/trace-event-parse.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/tools/perf/util/trace-event-parse.c b/tools/perf/util/trace-event-parse.c index a4088ced1e64..dfd1bd8371a4 100644 --- a/tools/perf/util/trace-event-parse.c +++ b/tools/perf/util/trace-event-parse.c | |||
| @@ -722,7 +722,7 @@ static char *event_read_name(void) | |||
| 722 | static int event_read_id(void) | 722 | static int event_read_id(void) |
| 723 | { | 723 | { |
| 724 | char *token; | 724 | char *token; |
| 725 | int id; | 725 | int id = -1; |
| 726 | 726 | ||
| 727 | if (read_expected_item(EVENT_ITEM, "ID") < 0) | 727 | if (read_expected_item(EVENT_ITEM, "ID") < 0) |
| 728 | return -1; | 728 | return -1; |
| @@ -731,15 +731,13 @@ static int event_read_id(void) | |||
| 731 | return -1; | 731 | return -1; |
| 732 | 732 | ||
| 733 | if (read_expect_type(EVENT_ITEM, &token) < 0) | 733 | if (read_expect_type(EVENT_ITEM, &token) < 0) |
| 734 | goto fail; | 734 | goto free; |
| 735 | 735 | ||
| 736 | id = strtoul(token, NULL, 0); | 736 | id = strtoul(token, NULL, 0); |
| 737 | free_token(token); | ||
| 738 | return id; | ||
| 739 | 737 | ||
| 740 | fail: | 738 | free: |
| 741 | free_token(token); | 739 | free_token(token); |
| 742 | return -1; | 740 | return id; |
| 743 | } | 741 | } |
| 744 | 742 | ||
| 745 | static int field_is_string(struct format_field *field) | 743 | static int field_is_string(struct format_field *field) |
