Minor cleanups.
authorcl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk>
Thu, 25 Aug 2005 18:49:48 +0000 (18:49 +0000)
committercl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk>
Thu, 25 Aug 2005 18:49:48 +0000 (18:49 +0000)
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
linux-2.6-xen-sparse/drivers/xen/blkback/interface.c
linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c
linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c

index 014e9ea34c44cfd9d2a7dd2824d0bf3a437a7724..79b37abc09a679e77b082f1d352902b23d394546 100644 (file)
@@ -124,6 +124,7 @@ static void free_blkif(void *arg)
     if (blkif->blk_ring.sring) {
        unmap_frontend_page(blkif);
        vfree(blkif->blk_ring.sring);
+       blkif->blk_ring.sring = NULL;
     }
 
     kmem_cache_free(blkif_cachep, blkif);
index 9a40935905b01a419731666a8985e7fca6911579..758159cbe255397b92a222648e3f9370b52cd9e2 100644 (file)
@@ -1258,6 +1258,7 @@ static int blkfront_probe(struct xenbus_device *dev,
        err = talk_to_backend(dev, info);
        if (err) {
                kfree(info);
+               dev->data = NULL;
                return err;
        }
 
index 90fb05fa405221aa2b2c0a61e6b4a97cbafb175c..9ecf176e73890bf5e23daf93cad58dfaba320e64 100644 (file)
@@ -939,7 +939,6 @@ static int create_netdev(int handle, struct xenbus_device *dev,
 
 static int destroy_netdev(struct net_device *netdev)
 {
-       struct net_private *np = NULL;
 
 #ifdef CONFIG_PROC_FS
        xennet_proc_delif(netdev);
@@ -947,11 +946,6 @@ static int destroy_netdev(struct net_device *netdev)
 
         unregister_netdev(netdev);
 
-       np = netdev_priv(netdev);
-       list_del(&np->list);
-
-       kfree(netdev);
-
        return 0;
 }
 
@@ -1244,12 +1238,17 @@ static int netfront_probe(struct xenbus_device *dev,
        }
 
        info = netdev_priv(netdev);
+       dev->data = info;
+
        err = talk_to_backend(dev, info);
        if (err) {
                destroy_netdev(netdev);
+               kfree(netdev);
+               dev->data = NULL;
                return err;
        }
 
+
        /* Call once in case entries already there. */
        watch_for_status(&info->watch, info->watch.node);