All of lore.kernel.org
 help / color / mirror / Atom feed
* Possible bug in xenbus __xenbus_switch_state
@ 2014-12-04  9:40 Andrew Reimers
  2014-12-04 10:23 ` David Vrabel
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Reimers @ 2014-12-04  9:40 UTC (permalink / raw)
  To: xen-devel@lists.xen.org

HI,

Looking at the function __xenbus_switch_state in file source/drivers/xen/xenbus/xenbus_client.c,

The comment says:

"We check whether the state is currently set to the given value, and
	   if not, then the state is set."

The code loads the old state value, but never does anything with it.

I would expect it to look something like:

err = xenbus_scanf(xbt, dev->nodename, "state", "%d", &current_state);
if (err != 1 || current_state != state) {
	err = xenbus_printf(xbt, dev->nodename, "state", "%d", state);
		if (err) {
		xenbus_switch_fatal(dev, depth, err, "writing new state");
		goto abort;
	}
}

--
Andrew Reimers

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-12-04 10:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-04  9:40 Possible bug in xenbus __xenbus_switch_state Andrew Reimers
2014-12-04 10:23 ` David Vrabel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.