[PATCH v1 0/3] rtc: ftrtc010: fix resource management and integer overflow
From: Liu Dalin
Date: Thu Aug 27 2026 - 02:36:16 EST
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.
Liu Dalin (3):
rtc: ftrtc010: fix clock resource leak on probe failure
rtc: ftrtc010: use devm clock APIs to fix use-after-disable in remove
rtc: ftrtc010: fix integer overflow in time calculation
drivers/rtc/rtc-ftrtc010.c | 72 ++++++++++++++------------------------
1 file changed, 25 insertions(+), 47 deletions(-)
--
2.43.0