summaryrefslogtreecommitdiffstats
path: root/drivers/rtc
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@bootlin.com>2022-07-27 12:00:18 +0200
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2022-08-08 20:35:41 +0200
commitc9a1dd673f28da9624776e75b78ae04125544852 (patch)
tree903ddf73ef1f2787572fe739aa541ad6268beb53 /drivers/rtc
parentrtc: Add NCT3018Y real time clock driver (diff)
downloadlinux-c9a1dd673f28da9624776e75b78ae04125544852.tar.xz
linux-c9a1dd673f28da9624776e75b78ae04125544852.zip
rtc: zynqmp: initialize fract_tick
fract_tick is used uninitialized when fract_offset is 0 Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Reviewed-by: Nathan Chancellor <nathan@kernel.org> Reviewed-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/20220727100018.3301470-1-alexandre.belloni@bootlin.com
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-zynqmp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/rtc/rtc-zynqmp.c b/drivers/rtc/rtc-zynqmp.c
index 1dd389b891fe..c9b85c838ebe 100644
--- a/drivers/rtc/rtc-zynqmp.c
+++ b/drivers/rtc/rtc-zynqmp.c
@@ -203,7 +203,7 @@ static int xlnx_rtc_set_offset(struct device *dev, long offset)
struct xlnx_rtc_dev *xrtcdev = dev_get_drvdata(dev);
unsigned long long rtc_ppb = RTC_PPB;
unsigned int tick_mult = do_div(rtc_ppb, xrtcdev->freq);
- unsigned char fract_tick;
+ unsigned char fract_tick = 0;
unsigned int calibval;
short int max_tick;
int fract_offset;