[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87msjw2al8.fsf@linux.intel.com>
Date: Wed, 25 Sep 2024 05:15:31 -0700
From: Andi Kleen <ak@...ux.intel.com>
To: Levi Yun <yeoreum.yun@....com>
Cc: peterz@...radead.org, mingo@...hat.com, acme@...nel.org,
namhyung@...nel.org, mark.rutland@....com,
alexander.shishkin@...ux.intel.com, jolsa@...nel.org,
irogers@...gle.com, adrian.hunter@...el.com, james.clark@...aro.org,
howardchu95@...il.com, nd@....com, linux-perf-users@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v5 1/2] perf stat: Close cork_fd when
create_perf_stat_counter() failed
Levi Yun <yeoreum.yun@....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@...ux.intel.com>
Powered by blists - more mailing lists