lkml.org 
[lkml]   [2011]   [Sep]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 7/9] xen/xenbus: Check before dereferencing it.
Date
. we do the check whether 'xdev' is NULL - but after we have
dereferenced it.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
drivers/xen/xenbus/xenbus_probe_backend.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/xen/xenbus/xenbus_probe_backend.c b/drivers/xen/xenbus/xenbus_probe_backend.c
index 60adf91..331589a 100644
--- a/drivers/xen/xenbus/xenbus_probe_backend.c
+++ b/drivers/xen/xenbus/xenbus_probe_backend.c
@@ -103,10 +103,11 @@ static int xenbus_uevent_backend(struct device *dev,
return -ENODEV;

xdev = to_xenbus_device(dev);
- bus = container_of(xdev->dev.bus, struct xen_bus_type, bus);
if (xdev == NULL)
return -ENODEV;

+ bus = container_of(xdev->dev.bus, struct xen_bus_type, bus);
+
if (add_uevent_var(env, "MODALIAS=xen-backend:%s", xdev->devicetype))
return -ENOMEM;

--
1.7.4.1


\
 
 \ /
  Last update: 2011-09-29 21:57    [W:0.140 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site