Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Jan Beulich and committed by
Wim Van Sebroeck
38c484fa 83448bf7

+5 -3
+5 -3
drivers/watchdog/xen_wdt.c
··· 132 132 133 133 static int xen_wdt_release(struct inode *inode, struct file *file) 134 134 { 135 + int err = 0; 136 + 135 137 if (expect_release) 136 - xen_wdt_stop(); 138 + err = xen_wdt_stop(); 137 139 else { 138 140 pr_crit("unexpected close, not stopping watchdog!\n"); 139 141 xen_wdt_kick(); 140 142 } 141 - is_active = false; 143 + is_active = err; 142 144 expect_release = false; 143 - return 0; 145 + return err; 144 146 } 145 147 146 148 static ssize_t xen_wdt_write(struct file *file, const char __user *data,