Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 842f07f6 authored by Borislav Petkov's avatar Borislav Petkov Committed by Arnaldo Carvalho de Melo
Browse files

perf tools: Simplify event_read_id exit path



We're freeing the token in any case so simplify the exit path by
unifying it.

No functional change.

Signed-off-by: default avatarBorislav Petkov <bp@amd64.org>
Link: http://lkml.kernel.org/r/1332339347-21342-1-git-send-email-bp@amd64.org


Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 0d09eb7a
Loading
Loading
Loading
Loading
+4 −6
Original line number Original line Diff line number Diff line
@@ -722,7 +722,7 @@ static char *event_read_name(void)
static int event_read_id(void)
static int event_read_id(void)
{
{
	char *token;
	char *token;
	int id;
	int id = -1;


	if (read_expected_item(EVENT_ITEM, "ID") < 0)
	if (read_expected_item(EVENT_ITEM, "ID") < 0)
		return -1;
		return -1;
@@ -731,15 +731,13 @@ static int event_read_id(void)
		return -1;
		return -1;


	if (read_expect_type(EVENT_ITEM, &token) < 0)
	if (read_expect_type(EVENT_ITEM, &token) < 0)
		goto fail;
		goto free;


	id = strtoul(token, NULL, 0);
	id = strtoul(token, NULL, 0);
	free_token(token);
	return id;


 fail:
 free:
	free_token(token);
	free_token(token);
	return -1;
	return id;
}
}


static int field_is_string(struct format_field *field)
static int field_is_string(struct format_field *field)