diff options
author | Jan Beulich <JBeulich@suse.com> | 2012-03-19 05:32:28 -0400 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2012-03-27 14:13:55 -0400 |
commit | 38c484fa136f66224694af298f80e96bf4072700 (patch) | |
tree | ca44de3b6d55a49969e7013538f9bdfafbb930eb /drivers/watchdog | |
parent | 83448bf7867917d5fd104e65275d8e153f3293a8 (diff) |
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')
-rw-r--r-- | drivers/watchdog/xen_wdt.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/watchdog/xen_wdt.c b/drivers/watchdog/xen_wdt.c index e04fd6cf2121..e4a25b51165c 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) | |||
132 | 132 | ||
133 | static int xen_wdt_release(struct inode *inode, struct file *file) | 133 | static int xen_wdt_release(struct inode *inode, struct file *file) |
134 | { | 134 | { |
135 | int err = 0; | ||
136 | |||
135 | if (expect_release) | 137 | if (expect_release) |
136 | xen_wdt_stop(); | 138 | err = xen_wdt_stop(); |
137 | else { | 139 | else { |
138 | pr_crit("unexpected close, not stopping watchdog!\n"); | 140 | pr_crit("unexpected close, not stopping watchdog!\n"); |
139 | xen_wdt_kick(); | 141 | xen_wdt_kick(); |
140 | } | 142 | } |
141 | is_active = false; | 143 | is_active = err; |
142 | expect_release = false; | 144 | expect_release = false; |
143 | return 0; | 145 | return err; |
144 | } | 146 | } |
145 | 147 | ||
146 | static ssize_t xen_wdt_write(struct file *file, const char __user *data, | 148 | static ssize_t xen_wdt_write(struct file *file, const char __user *data, |