[PATCH] watchdog/xen: don't clear is_active when xen_wdt_stop() failed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxx>

---
 drivers/watchdog/xen_wdt.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

--- 3.3/drivers/watchdog/xen_wdt.c
+++ 3.3-xen-watchdog-release/drivers/watchdog/xen_wdt.c
@@ -131,16 +131,18 @@ static int xen_wdt_open(struct inode *in
 
 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 {
 		printk(KERN_CRIT PFX
 		       "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,



--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux