ia64/xen-unstable

changeset 6817:feff6bf0417e

Free blkif if vbd_create fails.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk
date Tue Sep 13 19:43:58 2005 +0000 (2005-09-13)
parents 3a34bcb7c28b
children a0399927e1a1
files linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c	Tue Sep 13 19:09:44 2005 +0000
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c	Tue Sep 13 19:43:58 2005 +0000
     1.3 @@ -170,7 +170,6 @@ static void backend_changed(struct xenbu
     1.4  
     1.5  		be->blkif = alloc_blkif(be->frontend_id);
     1.6  		if (IS_ERR(be->blkif)) {
     1.7 -                        /* XXX SMH: should free blkif here... hmm */
     1.8  			err = PTR_ERR(be->blkif);
     1.9  			be->blkif = NULL;
    1.10  			xenbus_dev_error(dev, err, "creating block interface");
    1.11 @@ -179,8 +178,8 @@ static void backend_changed(struct xenbu
    1.12  
    1.13  		err = vbd_create(be->blkif, handle, be->pdev, be->readonly);
    1.14  		if (err) {
    1.15 -                        /* XXX SMH: should free blkif here too... */
    1.16 -                        be->blkif = NULL; 
    1.17 +			blkif_put(be->blkif);
    1.18 +			be->blkif = NULL;
    1.19  			xenbus_dev_error(dev, err, "creating vbd structure");
    1.20  			return;
    1.21  		}