direct-io.hg

changeset 14094:5ba3037ea5e1

[TAPDISK] handle error case when opening VDIs
author Jake Wires <jwires@xensource.com>
date Fri Feb 23 09:40:32 2007 -0800 (2007-02-23)
parents ee4850bc895b
children e9bd3267ff23
files tools/blktap/drivers/tapdisk.c
line diff
     1.1 --- a/tools/blktap/drivers/tapdisk.c	Fri Feb 23 17:02:58 2007 +0000
     1.2 +++ b/tools/blktap/drivers/tapdisk.c	Fri Feb 23 09:40:32 2007 -0800
     1.3 @@ -306,8 +306,11 @@ static int open_disk(struct td_state *s,
     1.4  		return -ENOMEM;
     1.5  
     1.6  	err = drv->td_open(d, path, 0);
     1.7 -	if (err)
     1.8 -		goto fail;
     1.9 +	if (err) {
    1.10 +		free_driver(d);
    1.11 +		s->disks = NULL;
    1.12 +		return -ENOMEM;
    1.13 +	}
    1.14  
    1.15  	/* load backing files as necessary */
    1.16  	while ((err = d->drv->td_get_parent_id(d, &id)) == 0) {