ia64/xen-unstable

changeset 8530:fbf58585008a

free trans if allocated, if dev_request_and_reply fail.

Signed-off-by: Vincent Hanquez <vincent@xensource.com>
author vhanquez@kneesa.uk.xensource.com
date Mon Jan 09 13:11:55 2006 +0000 (2006-01-09)
parents 96c7303b03ab
children dfb836264898
files linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c	Mon Jan 09 11:31:49 2006 +0000
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c	Mon Jan 09 13:11:55 2006 +0000
     1.3 @@ -109,7 +109,7 @@ static ssize_t xenbus_dev_write(struct f
     1.4  				size_t len, loff_t *ppos)
     1.5  {
     1.6  	struct xenbus_dev_data *u = filp->private_data;
     1.7 -	struct xenbus_dev_transaction *trans;
     1.8 +	struct xenbus_dev_transaction *trans = NULL;
     1.9  	void *reply;
    1.10  
    1.11  	if ((len + u->len) > sizeof(u->u.buffer))
    1.12 @@ -141,8 +141,10 @@ static ssize_t xenbus_dev_write(struct f
    1.13  		}
    1.14  
    1.15  		reply = xenbus_dev_request_and_reply(&u->u.msg);
    1.16 -		if (IS_ERR(reply))
    1.17 +		if (IS_ERR(reply)) {
    1.18 +			kfree(trans);
    1.19  			return PTR_ERR(reply);
    1.20 +		}
    1.21  
    1.22  		if (u->u.msg.type == XS_TRANSACTION_START) {
    1.23  			trans->handle = (struct xenbus_transaction *)