Commit c251f15c authored by Jan Beulich's avatar Jan Beulich Committed by David Vrabel

xenbus: check return value of xenbus_scanf()

Don't ignore errors here: Set backend state to unknown when
unsuccessful.
Signed-off-by: default avatarJan Beulich <jbeulich@suse.com>
Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
parent e1e5b3ff
...@@ -335,7 +335,9 @@ static int backend_state; ...@@ -335,7 +335,9 @@ static int backend_state;
static void xenbus_reset_backend_state_changed(struct xenbus_watch *w, static void xenbus_reset_backend_state_changed(struct xenbus_watch *w,
const char **v, unsigned int l) 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", printk(KERN_DEBUG "XENBUS: backend %s %s\n",
v[XS_WATCH_PATH], xenbus_strstate(backend_state)); v[XS_WATCH_PATH], xenbus_strstate(backend_state));
wake_up(&backend_state_wq); wake_up(&backend_state_wq);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment