diff options
Diffstat (limited to 'drivers/watchdog/watchdog_dev.c')
-rw-r--r-- | drivers/watchdog/watchdog_dev.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/watchdog/watchdog_dev.c b/drivers/watchdog/watchdog_dev.c index faf4e189fe42..6aaefbad303e 100644 --- a/drivers/watchdog/watchdog_dev.c +++ b/drivers/watchdog/watchdog_dev.c | |||
@@ -469,8 +469,10 @@ static int watchdog_release(struct inode *inode, struct file *file) | |||
469 | * or if WDIOF_MAGICCLOSE is not set. If nowayout was set then | 469 | * or if WDIOF_MAGICCLOSE is not set. If nowayout was set then |
470 | * watchdog_stop will fail. | 470 | * watchdog_stop will fail. |
471 | */ | 471 | */ |
472 | if (test_and_clear_bit(WDOG_ALLOW_RELEASE, &wdd->status) || | 472 | if (!test_bit(WDOG_ACTIVE, &wdd->status)) |
473 | !(wdd->info->options & WDIOF_MAGICCLOSE)) | 473 | err = 0; |
474 | else if (test_and_clear_bit(WDOG_ALLOW_RELEASE, &wdd->status) || | ||
475 | !(wdd->info->options & WDIOF_MAGICCLOSE)) | ||
474 | err = watchdog_stop(wdd); | 476 | err = watchdog_stop(wdd); |
475 | 477 | ||
476 | /* If the watchdog was not stopped, send a keepalive ping */ | 478 | /* If the watchdog was not stopped, send a keepalive ping */ |