From: Markus Elfring <Markus.Elfring@web.de>
To: linux-perf-users@vger.kernel.org,
kernel-janitors@vger.kernel.org,
Adrian Hunter <adrian.hunter@intel.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Ian Rogers <irogers@google.com>, Ingo Molnar <mingo@redhat.com>,
Jiri Olsa <jolsa@kernel.org>, Mark Rutland <mark.rutland@arm.com>,
Peter Zijlstra <peterz@infradead.org>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: [RFC] perf: Reconsider an error code selection in bpf_map__fprintf()
Date: Thu, 1 Feb 2024 19:21:53 +0100 [thread overview]
Message-ID: <f15f0df1-92be-4bc9-82a2-1d8fa3275dd7@web.de> (raw)
Hello,
A null pointer check is performed for the input parameter “map”.
It looks suspicious that the function “PTR_ERR” is applied then for
a corresponding return statement.
https://elixir.bootlin.com/linux/v6.8-rc2/source/tools/perf/util/bpf_map.c#L29
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/perf/util/bpf_map.c?h=v6.8-rc2&id=41bccc98fb7931d63d03f326a746ac4d429c1dd3#n29
This issue was detected by using the Coccinelle software.
Would any other error code determination be more appropriate here?
Regards,
Markus
next reply other threads:[~2024-02-01 18:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-01 18:21 Markus Elfring [this message]
2024-02-02 6:48 ` [RFC] perf: Reconsider an error code selection in bpf_map__fprintf() Markus Elfring
2024-02-06 2:12 ` Namhyung Kim
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=f15f0df1-92be-4bc9-82a2-1d8fa3275dd7@web.de \
--to=markus.elfring@web.de \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=irogers@google.com \
--cc=jolsa@kernel.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--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).