From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-yh0-f50.google.com ([209.85.213.50]:59291 "EHLO mail-yh0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755011AbaLHRpk (ORCPT ); Mon, 8 Dec 2014 12:45:40 -0500 From: Robert Yang To: Wim Van Seroeck , Cc: linux-kernel@vger.kernel.org, ryang Subject: [PATCH 1/1] Watchdog: Fixed the watchdog close/stop logic - only close the watchdog if the magic character was received and the magic close is supported. Date: Mon, 8 Dec 2014 10:45:11 -0700 Message-Id: <1418060711-47872-1-git-send-email-hachyang@gmail.com> Sender: linux-watchdog-owner@vger.kernel.org List-Id: linux-watchdog@vger.kernel.org From: ryang Signed-off-by: ryang --- drivers/watchdog/watchdog_dev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/watchdog/watchdog_dev.c b/drivers/watchdog/watchdog_dev.c index 6aaefba..73793d8 100644 --- a/drivers/watchdog/watchdog_dev.c +++ b/drivers/watchdog/watchdog_dev.c @@ -471,8 +471,8 @@ static int watchdog_release(struct inode *inode, struct file *file) */ 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)) + else if (test_and_clear_bit(WDOG_ALLOW_RELEASE, &wdd->status) && + (wdd->info->options & WDIOF_MAGICCLOSE)) err = watchdog_stop(wdd); /* If the watchdog was not stopped, send a keepalive ping */ -- 1.9.1