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


Groups > linux.kernel > #1507282 > unrolled thread

[PATCH RESEND] xenbus: check return value of xenbus_scanf()

Started by"Jan Beulich" <JBeulich@suse.com>
First post2016-10-24 17:10 +0200
Last post2016-10-24 17:10 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH RESEND] xenbus: check return value of xenbus_scanf() "Jan Beulich" <JBeulich@suse.com> - 2016-10-24 17:10 +0200

#1507282 — [PATCH RESEND] xenbus: check return value of xenbus_scanf()

From"Jan Beulich" <JBeulich@suse.com>
Date2016-10-24 17:10 +0200
Subject[PATCH RESEND] xenbus: check return value of xenbus_scanf()
Message-ID<svP2W-Pj-19@gated-at.bofh.it>
Don't ignore errors here: Set backend state to unknown when
unsuccessful.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 drivers/xen/xenbus/xenbus_probe_frontend.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- 4.9-rc2/drivers/xen/xenbus/xenbus_probe_frontend.c
+++ 4.9-rc2-xenbus-xenbus_scanf/drivers/xen/xenbus/xenbus_probe_frontend.c
@@ -335,7 +335,9 @@ static int backend_state;
 static void xenbus_reset_backend_state_changed(struct xenbus_watch *w,
 					const char **v, unsigned int l)
 {
-	xenbus_scanf(XBT_NIL, v[XS_WATCH_PATH], "", "%i", &backend_state);
+	if (xenbus_scanf(XBT_NIL, v[XS_WATCH_PATH], "", "%i",
+			 &backend_state) != 1)
+		backend_state = XenbusStateUnknown;
 	printk(KERN_DEBUG "XENBUS: backend %s %s\n",
 			v[XS_WATCH_PATH], xenbus_strstate(backend_state));
 	wake_up(&backend_state_wq);

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web