Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1438245 > unrolled thread

[PATCH] xen/manage: correct return value check on xenbus_scanf()

Started by"Jan Beulich" <JBeulich@suse.com>
First post2016-07-07 09:50 +0200
Last post2016-07-07 09:50 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] xen/manage: correct return value check on  xenbus_scanf() "Jan Beulich" <JBeulich@suse.com> - 2016-07-07 09:50 +0200

#1438245 — [PATCH] xen/manage: correct return value check on xenbus_scanf()

From"Jan Beulich" <JBeulich@suse.com>
Date2016-07-07 09:50 +0200
Subject[PATCH] xen/manage: correct return value check on xenbus_scanf()
Message-ID<rScem-3Vx-23@gated-at.bofh.it>
Only a positive return value indicates success.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 drivers/xen/manage.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- 4.7-rc6-xenbus_scanf.orig/drivers/xen/manage.c
+++ 4.7-rc6-xenbus_scanf/drivers/xen/manage.c
@@ -275,7 +275,7 @@ static void sysrq_handler(struct xenbus_
 	err = xenbus_transaction_start(&xbt);
 	if (err)
 		return;
-	if (!xenbus_scanf(xbt, "control", "sysrq", "%c", &sysrq_key)) {
+	if (xenbus_scanf(xbt, "control", "sysrq", "%c", &sysrq_key) <= 0) {
 		pr_err("Unable to read sysrq code in control/sysrq\n");
 		xenbus_transaction_end(xbt, 1);
 		return;

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web