summaryrefslogtreecommitdiffstats
path: root/drivers/watchdog/xen_wdt.c
diff options
context:
space:
mode:
authorJan Beulich <JBeulich@suse.com>2012-03-19 09:32:28 +0000
committerWim Van Sebroeck <wim@iguana.be>2012-03-27 20:13:55 +0200
commit38c484fa136f66224694af298f80e96bf4072700 (patch)
treeca44de3b6d55a49969e7013538f9bdfafbb930eb /drivers/watchdog/xen_wdt.c
parent83448bf7867917d5fd104e65275d8e153f3293a8 (diff)
downloadop-kernel-dev-38c484fa136f66224694af298f80e96bf4072700.zip
op-kernel-dev-38c484fa136f66224694af298f80e96bf4072700.tar.gz
watchdog: xen: don't clear is_active when xen_wdt_stop() failed
xen_wdt_release() shouldn't clear is_active even when the watchdog didn't get stopped (which by itself shouldn't happen, but let's return a proper error in this case rather than adding a BUG() upon hypercall failure). Signed-off-by: Jan Beulich <jbeulich@suse.com> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers/watchdog/xen_wdt.c')
-rw-r--r--drivers/watchdog/xen_wdt.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/watchdog/xen_wdt.c b/drivers/watchdog/xen_wdt.c
index e04fd6c..e4a25b5 100644
--- a/drivers/watchdog/xen_wdt.c
+++ b/drivers/watchdog/xen_wdt.c
@@ -132,15 +132,17 @@ static int xen_wdt_open(struct inode *inode, struct file *file)
static int xen_wdt_release(struct inode *inode, struct file *file)
{
+ int err = 0;
+
if (expect_release)
- xen_wdt_stop();
+ err = xen_wdt_stop();
else {
pr_crit("unexpected close, not stopping watchdog!\n");
xen_wdt_kick();
}
- is_active = false;
+ is_active = err;
expect_release = false;
- return 0;
+ return err;
}
static ssize_t xen_wdt_write(struct file *file, const char __user *data,
OpenPOWER on IntegriCloud