Mailing List Archive

Put watch on device node only if probe was sucessful.
# HG changeset patch
# User emellor@leeni.uk.xensource.com
# Node ID 39a6161261041617d791279ce7dfdd60ce96709b
# Parent 25d0ba51338eb8dd6446cc2083ee34d89a6f6fcf
Put watch on device node only if probe was sucessful.

This fix segfault on netfront when creating more than three network devices on
domU.

Signed-off-by: Murillo F. Bernardes <mfb@br.ibm.com>

diff -r 25d0ba51338e -r 39a616126104 linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c
--- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c Wed Dec 14 12:52:02 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c Thu Dec 15 13:38:16 2005
@@ -338,6 +338,21 @@

DPRINTK("");

+ if (!drv->probe) {
+ err = -ENODEV;
+ goto fail;
+ }
+
+ id = match_device(drv->ids, dev);
+ if (!id) {
+ err = -ENODEV;
+ goto fail;
+ }
+
+ err = drv->probe(dev, id);
+ if (err)
+ goto fail;
+
err = talk_to_otherend(dev);
if (err) {
printk(KERN_WARNING
@@ -345,21 +360,6 @@
dev->nodename);
return err;
}
-
- if (!drv->probe) {
- err = -ENODEV;
- goto fail;
- }
-
- id = match_device(drv->ids, dev);
- if (!id) {
- err = -ENODEV;
- goto fail;
- }
-
- err = drv->probe(dev, id);
- if (err)
- goto fail;

return 0;
fail:

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xensource.com
http://lists.xensource.com/xen-changelog