Skip to content

Commit

Permalink
xenbus: check return value of xenbus_scanf()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jan Beulich authored and David Vrabel committed Oct 24, 2016
1 parent e1e5b3f commit c251f15
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/xen/xenbus/xenbus_probe_frontend.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c251f15

Please sign in to comment.