From: BitKeeper B. <ri...@su...> - 2005-03-07 18:03:31
|
ChangeSet 1.1159.256.22, 2005/03/07 14:32:50+00:00, vh...@ai... fix spinlock still held while leaving function in case of error Signed-off-by: Vincent Hanquez <vi...@xe...> ioremap.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff -Nru a/linux-2.6.10-xen-sparse/arch/xen/i386/mm/ioremap.c b/linux-2.6.10-xen-sparse/arch/xen/i386/mm/ioremap.c --- a/linux-2.6.10-xen-sparse/arch/xen/i386/mm/ioremap.c 2005-03-07 13:03:11 -05:00 +++ b/linux-2.6.10-xen-sparse/arch/xen/i386/mm/ioremap.c 2005-03-07 13:03:11 -05:00 @@ -354,22 +354,25 @@ { pgd_t * dir; unsigned long end = address + size; + int error; dir = pgd_offset(mm, address); if (address >= end) BUG(); spin_lock(&mm->page_table_lock); do { + error = -ENOMEM; pmd_t *pmd = pmd_alloc(mm, dir, address); if (!pmd) - return -ENOMEM; + break; + error = 0; direct_remap_area_pmd(mm, pmd, address, end - address, &v); address = (address + PGDIR_SIZE) & PGDIR_MASK; dir++; } while (address && (address < end)); spin_unlock(&mm->page_table_lock); - return 0; + return error; } |