From: Andi Kleen <ak@linux.intel.com>
To: Levi Yun <yeoreum.yun@arm.com>
Cc: peterz@infradead.org, mingo@redhat.com, acme@kernel.org,
namhyung@kernel.org, mark.rutland@arm.com,
alexander.shishkin@linux.intel.com, jolsa@kernel.org,
irogers@google.com, adrian.hunter@intel.com,
james.clark@linaro.org, howardchu95@gmail.com, nd@arm.com,
linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 1/2] perf stat: Close cork_fd when create_perf_stat_counter() failed
Date: Wed, 25 Sep 2024 05:15:31 -0700 [thread overview]
Message-ID: <87msjw2al8.fsf@linux.intel.com> (raw)
In-Reply-To: <20240925110802.2620613-2-yeoreum.yun@arm.com> (Levi Yun's message of "Wed, 25 Sep 2024 12:08:01 +0100")
Levi Yun <yeoreum.yun@arm.com> writes:
> +void evlist__cancel_workload(struct evlist *evlist)
> +{
> + int status;
> +
> + if (evlist->workload.cork_fd > 0) {
Technically 0 is a valid file descriptor. Check for >= 0
And make sure the field is initialized with -1
The rest looks fine to me.
Reviewed-by: Andi Kleen <ak@linux.intel.com>
next prev parent reply other threads:[~2024-09-25 12:15 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-25 11:08 [PATCH v5 0/2] Minor fixes error handling of perf stat Levi Yun
2024-09-25 11:08 ` [PATCH v5 1/2] perf stat: Close cork_fd when create_perf_stat_counter() failed Levi Yun
2024-09-25 12:15 ` Andi Kleen [this message]
2024-09-25 12:40 ` Yeo Reum Yun
2024-09-25 13:17 ` Andi Kleen
2024-09-25 11:08 ` [PATCH v5 2/2] perf stat: Stop repeating when ref_perf_stat() returns -1 Levi Yun
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=87msjw2al8.fsf@linux.intel.com \
--to=ak@linux.intel.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=howardchu95@gmail.com \
--cc=irogers@google.com \
--cc=james.clark@linaro.org \
--cc=jolsa@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=namhyung@kernel.org \
--cc=nd@arm.com \
--cc=peterz@infradead.org \
--cc=yeoreum.yun@arm.com \
/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
all inboxes | Powered by JetHome®