|
|
|
|
|
|
|
|
|
|
xen-devel
RE: [Xen-devel] Null-pointer access in netback_uevent
Check if drvdata has been set up yet and return if it hasn't
Signed-off-by: James Harper <james.harper@xxxxxxxxxxxxxxxx>
---
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@xxxxxxxx]
> Sent: Saturday, 29 May 2010 09:31
> To: James Harper
> Cc: Bastian Blank; xen-devel@xxxxxxxxxxxxxxxxxxx
> 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
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
<Prev in Thread] |
Current Thread |
[Next in Thread>
|
- Re: [Xen-devel] Re: Null-pointer access in netback_uevent, (continued)
RE: [Xen-devel] Null-pointer access in netback_uevent, James Harper
- RE: [Xen-devel] Null-pointer access in netback_uevent, James Harper
- RE: [Xen-devel] Null-pointer access in netback_uevent, James Harper
- Re: [Xen-devel] Null-pointer access in netback_uevent, Bastian Blank
- Re: [Xen-devel] Null-pointer access in netback_uevent, Jeremy Fitzhardinge
- RE: [Xen-devel] Null-pointer access in netback_uevent, James Harper
- Re: [Xen-devel] Null-pointer access in netback_uevent, Jeremy Fitzhardinge
- RE: [Xen-devel] Null-pointer access in netback_uevent,
James Harper <=
- Re: [Xen-devel] Null-pointer access in netback_uevent, Bastian Blank
- [Xen-devel] [PATCH] xen/netback: Fix null-pointer access in netback_uevent, Bastian Blank
- Re: [Xen-devel] [PATCH] xen/netback: Fix null-pointer access in netback_uevent, Jan Beulich
- Re: [Xen-devel] [PATCH] xen/netback: Fix null-pointer access in netback_uevent, Jan Beulich
|
|
|
|
|