Commit 31d47266 authored by Stefano Stabellini's avatar Stefano Stabellini Committed by Juergen Gross

xen/9pfs: initialize len to 0 to detect xenbus_read errors

In order to use "len" to check for xenbus_read errors properly, we need
to initialize len to 0 before passing it to xenbus_read.

CC: dan.carpenter@oracle.com
CC: jgross@suse.com
CC: boris.ostrovsky@oracle.com
CC: Eric Van Hensbergen <ericvh@gmail.com>
CC: Ron Minnich <rminnich@sandia.gov>
CC: Latchesar Ionkov <lucho@ionkov.net>
CC: v9fs-developer@lists.sourceforge.net
Signed-off-by: default avatarStefano Stabellini <stefano@aporeto.com>
Reviewed-by: default avatarJuergen Gross <jgross@suse.com>
Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
parent 29985b09
...@@ -386,7 +386,7 @@ static int xen_9pfs_front_probe(struct xenbus_device *dev, ...@@ -386,7 +386,7 @@ static int xen_9pfs_front_probe(struct xenbus_device *dev,
struct xenbus_transaction xbt; struct xenbus_transaction xbt;
struct xen_9pfs_front_priv *priv = NULL; struct xen_9pfs_front_priv *priv = NULL;
char *versions; char *versions;
unsigned int max_rings, max_ring_order, len; unsigned int max_rings, max_ring_order, len = 0;
versions = xenbus_read(XBT_NIL, dev->otherend, "versions", &len); versions = xenbus_read(XBT_NIL, dev->otherend, "versions", &len);
if (!len) if (!len)
......
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