linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RESEND] xenbus: check return value of xenbus_scanf()
@ 2016-10-24 15:05 Jan Beulich
  0 siblings, 0 replies; only message in thread
From: Jan Beulich @ 2016-10-24 15:05 UTC (permalink / raw)
  To: david.vrabel, boris.ostrovsky, Juergen Gross; +Cc: xen-devel, linux-kernel

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);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-10-24 15:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-24 15:05 [PATCH RESEND] xenbus: check return value of xenbus_scanf() Jan Beulich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).