direct-io.hg

changeset 6421:9fb0bad776dd

Minor cleanups.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk
date Thu Aug 25 18:49:48 2005 +0000 (2005-08-25)
parents b4b3f6be5226
children f850ac27a8d2 8799d14bef77
files 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
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkback/interface.c	Thu Aug 25 17:27:49 2005 +0000
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkback/interface.c	Thu Aug 25 18:49:48 2005 +0000
     1.3 @@ -124,6 +124,7 @@ static void free_blkif(void *arg)
     1.4      if (blkif->blk_ring.sring) {
     1.5  	unmap_frontend_page(blkif);
     1.6  	vfree(blkif->blk_ring.sring);
     1.7 +	blkif->blk_ring.sring = NULL;
     1.8      }
     1.9  
    1.10      kmem_cache_free(blkif_cachep, blkif);
     2.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c	Thu Aug 25 17:27:49 2005 +0000
     2.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c	Thu Aug 25 18:49:48 2005 +0000
     2.3 @@ -1258,6 +1258,7 @@ static int blkfront_probe(struct xenbus_
     2.4  	err = talk_to_backend(dev, info);
     2.5  	if (err) {
     2.6  		kfree(info);
     2.7 +		dev->data = NULL;
     2.8  		return err;
     2.9  	}
    2.10  
     3.1 --- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c	Thu Aug 25 17:27:49 2005 +0000
     3.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c	Thu Aug 25 18:49:48 2005 +0000
     3.3 @@ -939,7 +939,6 @@ static int create_netdev(int handle, str
     3.4  
     3.5  static int destroy_netdev(struct net_device *netdev)
     3.6  {
     3.7 -	struct net_private *np = NULL;
     3.8  
     3.9  #ifdef CONFIG_PROC_FS
    3.10  	xennet_proc_delif(netdev);
    3.11 @@ -947,11 +946,6 @@ static int destroy_netdev(struct net_dev
    3.12  
    3.13          unregister_netdev(netdev);
    3.14  
    3.15 -	np = netdev_priv(netdev);
    3.16 -	list_del(&np->list);
    3.17 -
    3.18 -	kfree(netdev);
    3.19 -
    3.20  	return 0;
    3.21  }
    3.22  
    3.23 @@ -1244,12 +1238,17 @@ static int netfront_probe(struct xenbus_
    3.24  	}
    3.25  
    3.26  	info = netdev_priv(netdev);
    3.27 +	dev->data = info;
    3.28 +
    3.29  	err = talk_to_backend(dev, info);
    3.30  	if (err) {
    3.31  		destroy_netdev(netdev);
    3.32 +		kfree(netdev);
    3.33 +		dev->data = NULL;
    3.34  		return err;
    3.35  	}
    3.36  
    3.37 +
    3.38  	/* Call once in case entries already there. */
    3.39  	watch_for_status(&info->watch, info->watch.node);
    3.40