aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGuenter Roeck2016-08-09 22:35:58 -0700
committerWim Van Sebroeck2016-09-23 08:40:55 +0200
commitc97344f73fdc35b27c7315c5e7c5decd4ce10467 (patch)
tree4eab86e2fb4499e99dfc741e75127c6b0c6b1a6d /lib
parent2e91838bf7ffdedabdb29e091207d6531d04ef4f (diff)
watchdog: dw_wdt: Read clock rate only once and validate it
Coverity reports: divide_by_zero: In expression readl(dw_wdt->regs + 8) / clk_get_rate(dw_wdt->clk), division by expression clk_get_rate(dw_wdt->clk) which may be zero has undefined behavior. The clock used for the watchdog timer won't change its rate, so read it only once during probe. Also validate it and abort the probe function with an error if it is 0. Cc: Douglas Anderson <dianders@chromium.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'lib')
0 files changed, 0 insertions, 0 deletions