projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2724fb4
)
rtc: zynqmp: check calibration max value
author
Tomas Melin
<tomas.melin@vaisala.com>
Thu, 22 Jan 2026 13:53:46 +0000
(13:53 +0000)
committer
Alexandre Belloni
<alexandre.belloni@bootlin.com>
Thu, 29 Jan 2026 15:44:37 +0000
(16:44 +0100)
Enable check to not overflow the calibration
max value.
Reviewed-by: Harini T <harini.t@amd.com>
Tested-by: Harini T <harini.t@amd.com>
Signed-off-by: Tomas Melin <tomas.melin@vaisala.com>
Acked-by: Michal Simek <michal.simek@amd.com>
Link:
https://patch.msgid.link/20260122-zynqmp-rtc-updates-v4-2-d4edb966b499@vaisala.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-zynqmp.c
patch
|
blob
|
history
diff --git
a/drivers/rtc/rtc-zynqmp.c
b/drivers/rtc/rtc-zynqmp.c
index
856bc16
..
caacce3
100644
(file)
--- a/
drivers/rtc/rtc-zynqmp.c
+++ b/
drivers/rtc/rtc-zynqmp.c
@@
-349,6
+349,11
@@
static int xlnx_rtc_probe(struct platform_device *pdev)
xrtcdev->freq--;
}
+ if (xrtcdev->freq > RTC_TICK_MASK) {
+ dev_err(&pdev->dev, "Invalid RTC calibration value\n");
+ return -EINVAL;
+ }
+
ret = readl(xrtcdev->reg_base + RTC_CALIB_RD);
if (!ret)
writel(xrtcdev->freq, (xrtcdev->reg_base + RTC_CALIB_WR));