[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] alloc_netif() must return a ERR_PTR() on error, not NULL.
# 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
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |