summaryrefslogtreecommitdiffstats
path: root/drivers/xen
diff options
context:
space:
mode:
authorJan Beulich <JBeulich@suse.com>2016-10-24 09:05:18 -0600
committerDavid Vrabel <david.vrabel@citrix.com>2016-10-24 16:08:21 +0100
commitc251f15c7dbf2cb72e7b2b282020b41f4e4d3665 (patch)
tree955477018fb6dd653e31a755e9e19243136e1e4e /drivers/xen
parente1e5b3ff41983f506c3cbcf123fe7d682f61a8f1 (diff)
downloadlinux-c251f15c7dbf2cb72e7b2b282020b41f4e4d3665.tar.gz
linux-c251f15c7dbf2cb72e7b2b282020b41f4e4d3665.tar.bz2
linux-c251f15c7dbf2cb72e7b2b282020b41f4e4d3665.zip
xenbus: check return value of xenbus_scanf()
Don't ignore errors here: Set backend state to unknown when unsuccessful. Signed-off-by: Jan Beulich <jbeulich@suse.com> Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Diffstat (limited to 'drivers/xen')
-rw-r--r--drivers/xen/xenbus/xenbus_probe_frontend.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/xen/xenbus/xenbus_probe_frontend.c b/drivers/xen/xenbus/xenbus_probe_frontend.c
index 611a23119675..6d40a972ffb2 100644
--- a/drivers/xen/xenbus/xenbus_probe_frontend.c
+++ b/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);