xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: "James Harper" <james.harper@bendigoit.com.au>
To: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Bastian Blank <waldi@debian.org>, xen-devel@lists.xensource.com
Subject: RE: Null-pointer access in netback_uevent
Date: Sat, 29 May 2010 09:59:22 +1000	[thread overview]
Message-ID: <AEC6C66638C05B468B556EA548C1A77D01996C20@trantor> (raw)
In-Reply-To: <4C005228.5060107@goop.org>

[-- Attachment #1: Type: text/plain, Size: 1928 bytes --]

Check if drvdata has been set up yet and return if it hasn't

Signed-off-by: James Harper <james.harper@bendigoit.com.au>
---
 drivers/xen/netback/xenbus.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

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


> -----Original Message-----
> From: Jeremy Fitzhardinge [mailto:jeremy@goop.org]
> Sent: Saturday, 29 May 2010 09:31
> To: James Harper
> Cc: Bastian Blank; xen-devel@lists.xensource.com
> Subject: Re: [Xen-devel] Null-pointer access in netback_uevent
> 
> On 05/28/2010 03:42 PM, James Harper wrote:
> >>>> Looking into this further, I suspect that the trigger here is a newer
> >>>> version of udev or something in that area. netback_uevent is getting
> called
> >>>> before the call to netback_probe containing the call to dev_set_drvdata.
> >>>>
> >>>>
> >>> There are two problems there. And yes, the uevent routine can be called
> >>> at any time.
> >>>
> >>>
> >> So would it be correct for it to just return if either of those are
> >> NULL?
> >>
> > Not sure. It works though.
> >
> 
> Can you send me a properly signed-off patch?
> 
> Thanks,
>     J

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

  reply	other threads:[~2010-05-28 23:59 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-27 16:55 Null-pointer access in netback_uevent Bastian Blank
2010-05-27 21:03 ` Jeremy Fitzhardinge
2010-05-27 22:27   ` Bastian Blank
2010-05-27 22:39     ` Jeremy Fitzhardinge
2010-05-27 23:02       ` Bastian Blank
2010-05-28  0:04 ` James Harper
2010-05-28  0:33   ` James Harper
2010-05-28  0:47     ` James Harper
2010-05-28  9:03       ` Bastian Blank
2010-05-28 17:28         ` Jeremy Fitzhardinge
2010-05-28 22:42           ` James Harper
2010-05-28 23:30             ` Jeremy Fitzhardinge
2010-05-28 23:59               ` James Harper [this message]
2010-05-29  6:44                 ` Bastian Blank
2010-05-29 18:44                   ` [PATCH] xen/netback: Fix null-pointer " Bastian Blank
2010-05-31  7:37                     ` Jan Beulich
2010-05-31  8:07                       ` Jan Beulich
2010-07-28 16:20                         ` Bastian Blank
2010-07-29 11:47                           ` Ian Campbell
2010-07-29 12:42                             ` Bastian Blank
2010-07-29 13:44                               ` Ian Campbell
2010-07-29 13:48                                 ` Ian Campbell
2010-07-29 15:30                                 ` Bastian Blank
2010-07-29 15:40                                   ` Jeremy Fitzhardinge
2010-07-29 17:08                                     ` Bastian Blank

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=AEC6C66638C05B468B556EA548C1A77D01996C20@trantor \
    --to=james.harper@bendigoit.com.au \
    --cc=jeremy@goop.org \
    --cc=waldi@debian.org \
    --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).