[LTP] rtc02: skip (TCONF) on read-only RTCs that reject RTC_SET_TIME
linuxtestproject.agent@gmail.com
linuxtestproject.agent@gmail.com
Thu Jul 16 17:13:39 CEST 2026
Hi Kuba,
On Thu, 16 Jul 2026, Kuba Pawlak wrote:
> rtc02: skip (TCONF) on read-only RTCs that reject RTC_SET_TIME
> + if (tst_rtc_settime(rtc_dev, &probe_tm)) {
> + if (errno == ENODEV || errno == EOPNOTSUPP ||
> + errno == EINVAL || errno == EACCES || errno == EPERM)
> + tst_brk(TCONF | TERRNO,
> + "RTC does not support setting the time");
> +
> + tst_brk(TBROK | TERRNO, "ioctl() RTC_SET_TIME");
> + }
The fallthrough tst_brk() line uses a tab followed by four spaces instead
of two tabs. Everything else in the block uses tabs only; this one line
mixes whitespace.
Verdict - Needs revision
Pre-existing issues:
tst_rtc_ioctl() in lib/tst_rtctime.c does not close rtc_fd when ioctl()
fails:
ret = ioctl(rtc_fd, request, rtc_tm);
if (ret != 0)
return -1; /* rtc_fd leaked */
The new probe in rtc_setup() deliberately exercises this error path on
read-only devices, so on the hardware this patch targets the fd opened by
SAFE_OPEN() is leaked on every test run.
---
Note:
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
More information about the ltp
mailing list