xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: "James Harper" <james.harper@bendigoit.com.au>
To: xen-devel@lists.xensource.com
Subject: PATCH for NULL pointer in netback_uevent
Date: Fri, 28 May 2010 10:58:17 +1000	[thread overview]
Message-ID: <AEC6C66638C05B468B556EA548C1A77D01996BE1@trantor> (raw)

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  + 2.6.32.13-gf6fe658"). 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.

James

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;

        DPRINTK("netback_uevent");

+       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);

             reply	other threads:[~2010-05-28  0:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-28  0:58 James Harper [this message]
2010-05-28  7:15 ` PATCH for NULL pointer in netback_uevent Jan Beulich
2010-05-28  7:22   ` James Harper
2010-05-29 11:13   ` Andrew Lyon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AEC6C66638C05B468B556EA548C1A77D01996BE1@trantor \
    --to=james.harper@bendigoit.com.au \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).