Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

rtc: zynqmp: check calibration max value

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>

authored by

Tomas Melin and committed by
Alexandre Belloni
83b9e5eb 2724fb4d

+5
+5
drivers/rtc/rtc-zynqmp.c
··· 349 349 xrtcdev->freq--; 350 350 } 351 351 352 + if (xrtcdev->freq > RTC_TICK_MASK) { 353 + dev_err(&pdev->dev, "Invalid RTC calibration value\n"); 354 + return -EINVAL; 355 + } 356 + 352 357 ret = readl(xrtcdev->reg_base + RTC_CALIB_RD); 353 358 if (!ret) 354 359 writel(xrtcdev->freq, (xrtcdev->reg_base + RTC_CALIB_WR));