WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] alloc_netif() must return a ERR_PTR() on error, not NULL

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] alloc_netif() must return a ERR_PTR() on error, not NULL.
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 19 Oct 2005 12:08:19 +0000
Delivery-date: Wed, 19 Oct 2005 12:06:54 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 7169e31606bdff194606d5a991655ef4eed4324f
# Parent  551d099dae3a80ae913377f2de8e008bb88dadf5
alloc_netif() must return a ERR_PTR() on error, not NULL.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>

diff -r 551d099dae3a -r 7169e31606bd 
linux-2.6-xen-sparse/drivers/xen/netback/interface.c
--- a/linux-2.6-xen-sparse/drivers/xen/netback/interface.c      Tue Oct 18 
10:09:36 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/netback/interface.c      Tue Oct 18 
14:40:29 2005
@@ -58,7 +58,7 @@
        dev = alloc_netdev(sizeof(netif_t), name, ether_setup);
        if (dev == NULL) {
                DPRINTK("Could not create netif: out of memory\n");
-               return NULL;
+               return ERR_PTR(-ENOMEM);
        }
 
        netif = netdev_priv(dev);
@@ -104,7 +104,7 @@
                DPRINTK("Could not register new net device %s: err=%d\n",
                        dev->name, err);
                free_netdev(dev);
-               return NULL;
+               return ERR_PTR(err);
        }
 
        DPRINTK("Successfully created netif\n");
diff -r 551d099dae3a -r 7169e31606bd 
linux-2.6-xen-sparse/drivers/xen/netback/xenbus.c
--- a/linux-2.6-xen-sparse/drivers/xen/netback/xenbus.c Tue Oct 18 10:09:36 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/netback/xenbus.c Tue Oct 18 14:40:29 2005
@@ -28,10 +28,6 @@
        netif_t *netif;
 
        long int frontend_id;
-#if 0
-       long int pdev;
-       long int readonly;
-#endif
 
        /* watch back end for changes */
        struct xenbus_watch backend_watch;
@@ -154,14 +150,6 @@
                        xenbus_dev_error(dev, err, "creating interface");
                        return;
                }
-
-#if 0
-               err = vbd_create(be->netif, handle, be->pdev, be->readonly);
-               if (err) {
-                       xenbus_dev_error(dev, err, "creating vbd structure");
-                       return;
-               }
-#endif
 
                kobject_hotplug(&dev->dev.kobj, KOBJ_ONLINE);
 

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] alloc_netif() must return a ERR_PTR() on error, not NULL., Xen patchbot -unstable <=