[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] PATCH for NULL pointer in netback_uevent

  • To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • From: "James Harper" <james.harper@xxxxxxxxxxxxxxxx>
  • Date: Fri, 28 May 2010 10:58:17 +1000
  • Delivery-date: Thu, 27 May 2010 18:00:19 -0700
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • Thread-index: Acr+ANurGy/4Fs5cQRqJNaxhrk1XKA==
  • Thread-topic: PATCH for NULL pointer in netback_uevent

The following is sufficient to get domain creation working on my server
(see threads "null-pointer access in netback_uevent" and "oops starting
domain on 4.0.0  +"). I'm not sure if it's the right
solution though - should we expect a call to netback_uevent before the
vif is properly set up? All I'm doing is returning 0 (success?) if the
drvdata hasn't been set yet.

I also think that I am seeing a different problem to Bastian, based on
his debug output.


diff --git a/drivers/xen/netback/xenbus.c b/drivers/xen/netback/xenbus.c
index 70636d0..a46d8b2 100644
--- a/drivers/xen/netback/xenbus.c
+++ b/drivers/xen/netback/xenbus.c
@@ -162,12 +162,16 @@ fail:
 static int netback_uevent(struct xenbus_device *xdev, struct
kobj_uevent_env *env)
-       struct backend_info *be = dev_get_drvdata(&xdev->dev);
-       struct xen_netif *netif = be->netif;
+       struct backend_info *be;
+       struct xen_netif *netif;
        char *val;


+       be = dev_get_drvdata(&xdev->dev);
+       if (!be)
+               return 0;
+       netif = be->netif;
        val = xenbus_read(XBT_NIL, xdev->nodename, "script", NULL);
        if (IS_ERR(val)) {
                int err = PTR_ERR(val);

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.