diff options
author | Jan Beulich <JBeulich@suse.com> | 2016-10-24 09:05:18 -0600 |
---|---|---|
committer | David Vrabel <david.vrabel@citrix.com> | 2016-10-24 16:08:21 +0100 |
commit | c251f15c7dbf2cb72e7b2b282020b41f4e4d3665 (patch) | |
tree | 955477018fb6dd653e31a755e9e19243136e1e4e /drivers | |
parent | e1e5b3ff41983f506c3cbcf123fe7d682f61a8f1 (diff) | |
download | linux-stable-c251f15c7dbf2cb72e7b2b282020b41f4e4d3665.tar.gz linux-stable-c251f15c7dbf2cb72e7b2b282020b41f4e4d3665.tar.bz2 linux-stable-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')
-rw-r--r-- | drivers/xen/xenbus/xenbus_probe_frontend.c | 4 |
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); |