linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shang XiaoJing <shangxiaojing@huawei.com>
To: <peterz@infradead.org>, <mingo@redhat.com>, <acme@kernel.org>,
	<mark.rutland@arm.com>, <alexander.shishkin@linux.intel.com>,
	<jolsa@kernel.org>, <namhyung@kernel.org>,
	<linux-perf-users@vger.kernel.org>
Cc: <shangxiaojing@huawei.com>
Subject: [PATCH 1/4] perf genelf: Fix error code in jit_write_elf()
Date: Thu, 22 Sep 2022 22:14:35 +0800	[thread overview]
Message-ID: <20220922141438.22487-2-shangxiaojing@huawei.com> (raw)
In-Reply-To: <20220922141438.22487-1-shangxiaojing@huawei.com>

The error code is set to -1 at the beginning of jit_write_elf(), but it is
assigned by jit_add_eh_frame_info() in the middle, hence the following
error can only return the error code of jit_add_eh_frame_info(). Reset
the error code to the default value after being assigned by
jit_add_eh_frame_info().

Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
---
 tools/perf/util/genelf.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/perf/util/genelf.c b/tools/perf/util/genelf.c
index ed28a0dbcb7f..2e45b204494a 100644
--- a/tools/perf/util/genelf.c
+++ b/tools/perf/util/genelf.c
@@ -331,6 +331,7 @@ jit_write_elf(int fd, uint64_t load_addr, const char *sym,
 					       eh_frame_base_offset);
 		if (retval)
 			goto error;
+		retval = -1;
 	}
 
 	/*
-- 
2.17.1


  reply	other threads:[~2022-09-22 13:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-22 14:14 [PATCH 0/4] perf: Some clean up Shang XiaoJing
2022-09-22 14:14 ` Shang XiaoJing [this message]
2022-09-22 19:27   ` [PATCH 1/4] perf genelf: Fix error code in jit_write_elf() Arnaldo Carvalho de Melo
2022-09-22 14:14 ` [PATCH 2/4] perf stat: Merge cases in process_evlist Shang XiaoJing
2022-09-22 19:33   ` Arnaldo Carvalho de Melo
2022-09-22 14:14 ` [PATCH 3/4] perf top: Fix error code in cmd_top() Shang XiaoJing
2022-09-22 14:14 ` [PATCH 4/4] perf stat: Clean redundant if in process_evlist Shang XiaoJing
2022-09-22 19:54   ` Arnaldo Carvalho de Melo
2022-09-22 22:50     ` Ian Rogers
2022-09-26 20:32       ` Arnaldo Carvalho de Melo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220922141438.22487-2-shangxiaojing@huawei.com \
    --to=shangxiaojing@huawei.com \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=jolsa@kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).