Linux Test Project
 help / color / mirror / Atom feed
From: linuxtestproject.agent@gmail.com
To: Piotr Kubaj <piotr.kubaj@intel.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] cpufreq.c: add new test for cpufreq sysfs interface validation
Date: Wed,  6 May 2026 14:17:49 +0000	[thread overview]
Message-ID: <20260506141749.3914-1-linuxtestproject.agent@gmail.com> (raw)
In-Reply-To: <20260506130808.76820-2-piotr.kubaj@intel.com>

Hi Piotr,

On Wed, 6 May 2026, Piotr Kubaj wrote:
> cpufreq.c: add new test for cpufreq sysfs interface validation
>
> Runs various sanity checks for intel_pstate cpufreq sysfs interface.
> [...]

The commit body describes what the test does but not why it is needed.
The motivation ("LTP has no regression coverage for the intel_pstate
cpufreq sysfs interface...") belongs in the commit body, not only in
the in-source doc comment.

> +	fd = SAFE_OPEN(path, O_RDONLY);
> +	SAFE_READ(0, fd, contents, sizeof(contents));
> +	SAFE_CLOSE(fd);

If SAFE_READ fails it calls tst_brk(), skipping SAFE_CLOSE(). cleanup()
has no fd handling so the descriptor leaks. Use SAFE_FILE_SCANF() instead.
This pattern appears twice (~line 184 and ~line 298).

> +static bool setup_done;
[...]
> +	setup_done = true;

setup_done is never reset in cleanup(). With -i, a partial setup failure
on a later iteration sees stale 'true' and incorrectly enters the restore
path. Reset it at the start of setup() or end of cleanup().

---
Note:

Our agent completed the review of the patch. The agent can sometimes
produce false positives although often its findings are genuine. If you
find issues with the review, please comment this email or ignore the
suggestions.

Regards,
LTP AI Reviewer

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2026-05-06 14:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-06 13:08 [LTP] [PATCH v7] cpufreq.c: add new test for cpufreq sysfs interface validation Piotr Kubaj
2026-05-06 14:17 ` linuxtestproject.agent [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-05-07 11:11 [LTP] [PATCH v8] " Piotr Kubaj
2026-05-07 11:57 ` [LTP] " linuxtestproject.agent
2026-05-06  9:10 [LTP] [PATCH v6] " Piotr Kubaj
2026-05-06 12:47 ` [LTP] " linuxtestproject.agent
2026-05-05 11:02 [LTP] [PATCH v5] " Piotr Kubaj
2026-05-05 17:53 ` [LTP] " linuxtestproject.agent
2026-05-05  9:48 [LTP] [PATCH v4] " Piotr Kubaj
2026-05-05 10:53 ` [LTP] " linuxtestproject.agent
2026-05-04 10:08 [LTP] [PATCH v3] " Piotr Kubaj
2026-05-04 11:54 ` [LTP] " linuxtestproject.agent
2026-04-22 10:35 [LTP] [PATCH] " Piotr Kubaj
2026-04-22 11:11 ` [LTP] " linuxtestproject.agent

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=20260506141749.3914-1-linuxtestproject.agent@gmail.com \
    --to=linuxtestproject.agent@gmail.com \
    --cc=ltp@lists.linux.it \
    --cc=piotr.kubaj@intel.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