Skip to contentSkip to conversation

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

PATCH In review Stefano Stabellini 2 participants 2 messages Apr 13, 2017 – Apr 18, 2017 9P file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
Juergen, you could also merge this patch into commit e9c53da56ff36458b1b8df95573f5dac80a1a956
---

---
 net/9p/trans_xen.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/9p/trans_xen.c +1 -1
index 4786424..71e8564 100644
@@ -386,7 +386,7 @@ static int xen_9pfs_front_probe(struct xenbus_device *dev,
 	struct xenbus_transaction xbt;
 	struct xen_9pfs_front_priv *priv = NULL;
 	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);
 	if (!len)
Signature · 1 line
1.9.1
#1 lore raw
Quoted 11 lines · Stefano Stabellini

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.

Committed to xen/tip for-linus-4.12

Thanks,

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel