|
@@ -469,8 +469,10 @@ static int watchdog_release(struct inode *inode, struct file *file)
|
|
* or if WDIOF_MAGICCLOSE is not set. If nowayout was set then
|
|
* or if WDIOF_MAGICCLOSE is not set. If nowayout was set then
|
|
* watchdog_stop will fail.
|
|
* watchdog_stop will fail.
|
|
*/
|
|
*/
|
|
- if (test_and_clear_bit(WDOG_ALLOW_RELEASE, &wdd->status) ||
|
|
|
|
- !(wdd->info->options & WDIOF_MAGICCLOSE))
|
|
|
|
|
|
+ if (!test_bit(WDOG_ACTIVE, &wdd->status))
|
|
|
|
+ err = 0;
|
|
|
|
+ else if (test_and_clear_bit(WDOG_ALLOW_RELEASE, &wdd->status) ||
|
|
|
|
+ !(wdd->info->options & WDIOF_MAGICCLOSE))
|
|
err = watchdog_stop(wdd);
|
|
err = watchdog_stop(wdd);
|
|
|
|
|
|
/* If the watchdog was not stopped, send a keepalive ping */
|
|
/* If the watchdog was not stopped, send a keepalive ping */
|