diff options
Diffstat (limited to 'drivers/char/watchdog')
-rw-r--r-- | drivers/char/watchdog/iTCO_wdt.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/char/watchdog/iTCO_wdt.c b/drivers/char/watchdog/iTCO_wdt.c index 505aae917764..b6f29cb8bd39 100644 --- a/drivers/char/watchdog/iTCO_wdt.c +++ b/drivers/char/watchdog/iTCO_wdt.c | |||
@@ -368,7 +368,8 @@ static int iTCO_wdt_get_timeleft (int *time_left) | |||
368 | spin_unlock(&iTCO_wdt_private.io_lock); | 368 | spin_unlock(&iTCO_wdt_private.io_lock); |
369 | 369 | ||
370 | *time_left = (val8 * 6) / 10; | 370 | *time_left = (val8 * 6) / 10; |
371 | } | 371 | } else |
372 | return -EINVAL; | ||
372 | return 0; | 373 | return 0; |
373 | } | 374 | } |
374 | 375 | ||
@@ -439,7 +440,6 @@ static int iTCO_wdt_ioctl (struct inode *inode, struct file *file, | |||
439 | { | 440 | { |
440 | int new_options, retval = -EINVAL; | 441 | int new_options, retval = -EINVAL; |
441 | int new_heartbeat; | 442 | int new_heartbeat; |
442 | int time_left; | ||
443 | void __user *argp = (void __user *)arg; | 443 | void __user *argp = (void __user *)arg; |
444 | int __user *p = argp; | 444 | int __user *p = argp; |
445 | static struct watchdog_info ident = { | 445 | static struct watchdog_info ident = { |
@@ -499,6 +499,8 @@ static int iTCO_wdt_ioctl (struct inode *inode, struct file *file, | |||
499 | 499 | ||
500 | case WDIOC_GETTIMELEFT: | 500 | case WDIOC_GETTIMELEFT: |
501 | { | 501 | { |
502 | int time_left; | ||
503 | |||
502 | if (iTCO_wdt_get_timeleft(&time_left)) | 504 | if (iTCO_wdt_get_timeleft(&time_left)) |
503 | return -EINVAL; | 505 | return -EINVAL; |
504 | 506 | ||