From: sashiko-bot@kernel.org
To: "Antoni Pokusinski" <apokusinski01@gmail.com>
Cc: linux-rtc@vger.kernel.org, conor+dt@kernel.org,
devicetree@vger.kernel.org,
"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
robh@kernel.org
Subject: Re: [PATCH v6 9/9] rtc: abx80x: add support for ABX81X
Date: Mon, 07 Sep 2026 20:52:42 +0000 [thread overview]
Message-ID: <20260907205243.58FC71F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260907203216.53192-10-apokusinski01@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The `regmap_bulk_read` return value check in `abx80x_read_alarm` causes the function to unconditionally fail with `-EIO` on success.
--
commit 7f9a5b9080b676338469e285a0ce05b36660c82c
Author: Antoni Pokusinski <apokusinski01@gmail.com>
rtc: abx80x: add support for ABX81X
This patch adds support for the Abracon ABX81X family of RTCs, which feature
a SPI interface. It updates the Kconfig to support both I2C and SPI, and adds
the necessary SPI device IDs, device tree bindings, and probe functions.
> diff --git a/drivers/rtc/rtc-abx80x.c b/drivers/rtc/rtc-abx80x.c
> index c90407a023fe8..c3bf6f0ae48b9 100644
> --- a/drivers/rtc/rtc-abx80x.c
> +++ b/drivers/rtc/rtc-abx80x.c
> @@ -1,7 +1,7 @@
> // SPDX-License-Identifier: GPL-2.0
> /*
> - * A driver for the I2C members of the Abracon AB x8xx RTC family,
> - * and compatible: AB 1805 and AB 0805
> + * A driver for the I2C and SPI members of the Abracon AB x8xx RTC family,
> + * and compatible: AB 1805, AB 0805, AB 1815 and AB 0815
> *
> * Copyright 2014-2015 Macq S.A.
> *
[Severity: High]
Will the regmap_bulk_read return value check in abx80x_read_alarm() cause the
function to unconditionally fail?
drivers/rtc/rtc-abx80x.c:abx80x_read_alarm() {
...
err = regmap_bulk_read(priv->regmap, ABX8XX_REG_ASC, buf, sizeof(buf));
if (err)
return err;
if (err < ARRAY_SIZE(buf))
return -EIO;
...
}
When the RTC core calls abx80x_read_alarm(), regmap_bulk_read() will return 0
on a successful read. The subsequent check evaluates
if (err < ARRAY_SIZE(buf)), which is 0 < 7. This evaluates to true, resulting
in an unconditional return of -EIO and breaking the alarm read functionality
for any unprivileged userspace application reading the RTC alarm.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260907203216.53192-1-apokusinski01@gmail.com?part=9
prev parent reply other threads:[~2026-09-07 20:52 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-07 20:32 [PATCH v6 0/9] rtc: abx80x: add support for abx81x Antoni Pokusinski
2026-09-07 20:32 ` [PATCH v6 1/9] dt-bindings: rtc: abx80x: document ABX81X RTCs Antoni Pokusinski
2026-09-07 20:41 ` sashiko-bot
2026-09-07 20:32 ` [PATCH v6 2/9] rtc: abx80x: fix error check after i2c_smbus_read in read_alarm() Antoni Pokusinski
2026-09-07 20:41 ` sashiko-bot
2026-09-07 20:32 ` [PATCH v6 3/9] rtc: abx80x: add mutex protection for register writes Antoni Pokusinski
2026-09-07 20:46 ` sashiko-bot
2026-09-09 18:01 ` Antoni Pokusinski
2026-09-07 20:32 ` [PATCH v6 4/9] rtc: abx80x: properly handle shared IRQs Antoni Pokusinski
2026-09-07 20:46 ` sashiko-bot
2026-09-07 20:32 ` [PATCH v6 5/9] rtc: abx80x: add irq to struct abx80x_priv Antoni Pokusinski
2026-09-07 20:49 ` sashiko-bot
2026-09-07 20:32 ` [PATCH v6 6/9] rtc: abx80x: use regmap instead of I2C specific API Antoni Pokusinski
2026-09-07 20:47 ` sashiko-bot
2026-09-07 20:32 ` [PATCH v6 7/9] rtc: abx80x: replace read-modify-write pattern with regmap helpers Antoni Pokusinski
2026-09-07 20:46 ` sashiko-bot
2026-09-09 18:03 ` Antoni Pokusinski
2026-09-07 20:32 ` [PATCH v6 8/9] rtc: abx80x: create abx80x_i2c_probe() Antoni Pokusinski
2026-09-07 20:41 ` sashiko-bot
2026-09-07 20:32 ` [PATCH v6 9/9] rtc: abx80x: add support for ABX81X Antoni Pokusinski
2026-09-07 20:52 ` sashiko-bot [this message]
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=20260907205243.58FC71F00A3A@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=alexandre.belloni@bootlin.com \
--cc=apokusinski01@gmail.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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