Skip to content

Commit

Permalink
watchdog: xen: don't clear is_active when xen_wdt_stop() failed
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jan Beulich authored and Wim Van Sebroeck committed Mar 27, 2012
1 parent 83448bf commit 38c484f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drivers/watchdog/xen_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 38c484f

Please sign in to comment.