Re: [PATCH v2 0/3] rtc: ftrtc010: fix resource management and integer overflow

From: Linus Walleij

Date: Mon Sep 14 2026 - 04:40:42 EST


On Thu, Aug 27, 2026 at 10:03 AM Liu Dalin <liudalin@xxxxxxxxxxxxxxx> wrote:

> This series fixes three issues in the Faraday FTRTC010 RTC driver
> found by Sashiko AI static analysis:
>
> Patch 1: Fixes a clock resource leak when devm_rtc_register_device()
> fails in ftrtc010_rtc_probe().
>
> Patch 2: Replaces manual clock management with devm APIs to fix a
> use-after-disable vulnerability in ftrtc010_rtc_remove(). The RTC
> device is registered via devm_rtc_register_device() but clocks are
> manually disabled in .remove() before devres cleanup, creating a
> window where MMIO reads on clock-gated hardware can cause a
> synchronous external abort.
>
> Patch 3: Fixes integer overflow in ftrtc010_rtc_read_time() and
> ftrtc010_rtc_set_time() where u32 arithmetic wraps for dates
> beyond year 2106.
>
> All three patches are based on v7.2-rc2 and have been verified
> with checkpatch.pl --strict.

All patches:
Reviewed-by: Linus Walleij <linusw@xxxxxxxxxx>

Maybe they need rebasing on v7.3-rc1 or maybe they will just
apply cleanly (I think so).

Yours,
Linus Walleij