ia64/xen-unstable

changeset 3994:a5bf5769c2b8

bitkeeper revision 1.1159.258.22 (422c6612riGtD5GGqVTNqhuli2WrwQ)

fix spinlock still held while leaving function in case of error

Signed-off-by: Vincent Hanquez <vincent@xensource.com>
author vh249@airwolf.cl.cam.ac.uk
date Mon Mar 07 14:32:50 2005 +0000 (2005-03-07)
parents 4576c7b7063b
children 7d6b08b325ff aa00702b5bd6 0a2fa97dfafc
files BitKeeper/etc/logging_ok linux-2.6.10-xen-sparse/arch/xen/i386/mm/ioremap.c
line diff
     1.1 --- a/BitKeeper/etc/logging_ok	Fri Mar 04 00:57:22 2005 +0000
     1.2 +++ b/BitKeeper/etc/logging_ok	Mon Mar 07 14:32:50 2005 +0000
     1.3 @@ -63,4 +63,5 @@ tlh20@elite.cl.cam.ac.uk
     1.4  tlh20@labyrinth.cl.cam.ac.uk
     1.5  tw275@labyrinth.cl.cam.ac.uk
     1.6  tw275@striker.cl.cam.ac.uk
     1.7 +vh249@airwolf.cl.cam.ac.uk
     1.8  xenbk@gandalf.hpl.hp.com
     2.1 --- a/linux-2.6.10-xen-sparse/arch/xen/i386/mm/ioremap.c	Fri Mar 04 00:57:22 2005 +0000
     2.2 +++ b/linux-2.6.10-xen-sparse/arch/xen/i386/mm/ioremap.c	Mon Mar 07 14:32:50 2005 +0000
     2.3 @@ -354,22 +354,25 @@ int __direct_remap_area_pages(struct mm_
     2.4  {
     2.5  	pgd_t * dir;
     2.6  	unsigned long end = address + size;
     2.7 +	int error;
     2.8  
     2.9  	dir = pgd_offset(mm, address);
    2.10  	if (address >= end)
    2.11  		BUG();
    2.12  	spin_lock(&mm->page_table_lock);
    2.13  	do {
    2.14 +		error = -ENOMEM;
    2.15  		pmd_t *pmd = pmd_alloc(mm, dir, address);
    2.16  		if (!pmd)
    2.17 -			return -ENOMEM;
    2.18 +			break;
    2.19 +		error = 0;
    2.20  		direct_remap_area_pmd(mm, pmd, address, end - address, &v);
    2.21  		address = (address + PGDIR_SIZE) & PGDIR_MASK;
    2.22  		dir++;
    2.23  
    2.24  	} while (address && (address < end));
    2.25  	spin_unlock(&mm->page_table_lock);
    2.26 -	return 0;
    2.27 +	return error;
    2.28  }
    2.29  
    2.30