diff options
author | Guenter Roeck <linux@roeck-us.net> | 2016-08-09 22:35:58 -0700 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2016-09-23 08:40:55 +0200 |
commit | c97344f73fdc35b27c7315c5e7c5decd4ce10467 (patch) | |
tree | 4eab86e2fb4499e99dfc741e75127c6b0c6b1a6d /drivers/nubus | |
parent | 2e91838bf7ffdedabdb29e091207d6531d04ef4f (diff) | |
download | blackbird-op-linux-c97344f73fdc35b27c7315c5e7c5decd4ce10467.tar.gz blackbird-op-linux-c97344f73fdc35b27c7315c5e7c5decd4ce10467.zip |
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 'drivers/nubus')
0 files changed, 0 insertions, 0 deletions