diff options
author | David S. Miller <davem@davemloft.net> | 2014-11-29 23:47:48 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-11-29 23:47:48 -0500 |
commit | 60b7379dc5b1743427b031cca53e30860a38ada6 (patch) | |
tree | c0462b8dd188861bd04f36dd31672b7446e35dd8 /drivers/net/xen-netback | |
parent | a523a5ecc8c6ddceb8f783f600605553e5ad8963 (diff) | |
parent | 7a5a4f978750756755dc839014e13d1b088ccc8e (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'drivers/net/xen-netback')
-rw-r--r-- | drivers/net/xen-netback/xenbus.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/xenbus.c index 4e56a27f9689..fab0d4b42f58 100644 --- a/drivers/net/xen-netback/xenbus.c +++ b/drivers/net/xen-netback/xenbus.c | |||
@@ -39,7 +39,7 @@ struct backend_info { | |||
39 | static int connect_rings(struct backend_info *be, struct xenvif_queue *queue); | 39 | static int connect_rings(struct backend_info *be, struct xenvif_queue *queue); |
40 | static void connect(struct backend_info *be); | 40 | static void connect(struct backend_info *be); |
41 | static int read_xenbus_vif_flags(struct backend_info *be); | 41 | static int read_xenbus_vif_flags(struct backend_info *be); |
42 | static void backend_create_xenvif(struct backend_info *be); | 42 | static int backend_create_xenvif(struct backend_info *be); |
43 | static void unregister_hotplug_status_watch(struct backend_info *be); | 43 | static void unregister_hotplug_status_watch(struct backend_info *be); |
44 | static void set_backend_state(struct backend_info *be, | 44 | static void set_backend_state(struct backend_info *be, |
45 | enum xenbus_state state); | 45 | enum xenbus_state state); |
@@ -352,7 +352,9 @@ static int netback_probe(struct xenbus_device *dev, | |||
352 | be->state = XenbusStateInitWait; | 352 | be->state = XenbusStateInitWait; |
353 | 353 | ||
354 | /* This kicks hotplug scripts, so do it immediately. */ | 354 | /* This kicks hotplug scripts, so do it immediately. */ |
355 | backend_create_xenvif(be); | 355 | err = backend_create_xenvif(be); |
356 | if (err) | ||
357 | goto fail; | ||
356 | 358 | ||
357 | return 0; | 359 | return 0; |
358 | 360 | ||
@@ -397,19 +399,19 @@ static int netback_uevent(struct xenbus_device *xdev, | |||
397 | } | 399 | } |
398 | 400 | ||
399 | 401 | ||
400 | static void backend_create_xenvif(struct backend_info *be) | 402 | static int backend_create_xenvif(struct backend_info *be) |
401 | { | 403 | { |
402 | int err; | 404 | int err; |
403 | long handle; | 405 | long handle; |
404 | struct xenbus_device *dev = be->dev; | 406 | struct xenbus_device *dev = be->dev; |
405 | 407 | ||
406 | if (be->vif != NULL) | 408 | if (be->vif != NULL) |
407 | return; | 409 | return 0; |
408 | 410 | ||
409 | err = xenbus_scanf(XBT_NIL, dev->nodename, "handle", "%li", &handle); | 411 | err = xenbus_scanf(XBT_NIL, dev->nodename, "handle", "%li", &handle); |
410 | if (err != 1) { | 412 | if (err != 1) { |
411 | xenbus_dev_fatal(dev, err, "reading handle"); | 413 | xenbus_dev_fatal(dev, err, "reading handle"); |
412 | return; | 414 | return (err < 0) ? err : -EINVAL; |
413 | } | 415 | } |
414 | 416 | ||
415 | be->vif = xenvif_alloc(&dev->dev, dev->otherend_id, handle); | 417 | be->vif = xenvif_alloc(&dev->dev, dev->otherend_id, handle); |
@@ -417,10 +419,11 @@ static void backend_create_xenvif(struct backend_info *be) | |||
417 | err = PTR_ERR(be->vif); | 419 | err = PTR_ERR(be->vif); |
418 | be->vif = NULL; | 420 | be->vif = NULL; |
419 | xenbus_dev_fatal(dev, err, "creating interface"); | 421 | xenbus_dev_fatal(dev, err, "creating interface"); |
420 | return; | 422 | return err; |
421 | } | 423 | } |
422 | 424 | ||
423 | kobject_uevent(&dev->dev.kobj, KOBJ_ONLINE); | 425 | kobject_uevent(&dev->dev.kobj, KOBJ_ONLINE); |
426 | return 0; | ||
424 | } | 427 | } |
425 | 428 | ||
426 | static void backend_disconnect(struct backend_info *be) | 429 | static void backend_disconnect(struct backend_info *be) |