diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2015-11-06 04:56:31 -0500 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2015-11-23 02:59:30 -0500 |
commit | 62ed853c7de7a77bdf01421fb6836269c9b1aa1f (patch) | |
tree | 3064fea9ba4badc85af7233ddbe7dfdd216969bc /drivers/watchdog/w83977f_wdt.c | |
parent | 4c30737ce16612b0f3b840a7c9928385cbb67555 (diff) |
watchdog: w83977f_wdt: underflow in wdt_set_timeout()
"t" is controlled by the user. If "t" is a very large integer then it
could lead to a negative "tmrval". We cap the upper bound of "tmrval"
but, in the current code, we allow negatives. This is a bug and it
causes a static checker warning. Let's make "tmrval" unsigned to avoid
this problem.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers/watchdog/w83977f_wdt.c')
-rw-r--r-- | drivers/watchdog/w83977f_wdt.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/watchdog/w83977f_wdt.c b/drivers/watchdog/w83977f_wdt.c index 91bf55a20024..20e2bba10400 100644 --- a/drivers/watchdog/w83977f_wdt.c +++ b/drivers/watchdog/w83977f_wdt.c | |||
@@ -224,7 +224,7 @@ static int wdt_keepalive(void) | |||
224 | 224 | ||
225 | static int wdt_set_timeout(int t) | 225 | static int wdt_set_timeout(int t) |
226 | { | 226 | { |
227 | int tmrval; | 227 | unsigned int tmrval; |
228 | 228 | ||
229 | /* | 229 | /* |
230 | * Convert seconds to watchdog counter time units, rounding up. | 230 | * Convert seconds to watchdog counter time units, rounding up. |