xen: execve's error paths don't pin the mm before unpinning

execve's error paths don't activate (and therefore pin) the mm before
calling exit_mmap to free it up, so don't try to unpin unless it is
actually pinned. This prevents a BUG_ON from triggering.

Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
Cc: Christian Ostheimer <osth@freesurf.ch>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by Jeremy Fitzhardinge and committed by Linus Torvalds df912ea4 e66485d7

+4 -1
+4 -1
arch/i386/xen/mmu.c
··· 559 559 put_cpu(); 560 560 561 561 spin_lock(&mm->page_table_lock); 562 - xen_pgd_unpin(mm->pgd); 562 + 563 + /* pgd may not be pinned in the error exit path of execve */ 564 + if (PagePinned(virt_to_page(mm->pgd))) 565 + xen_pgd_unpin(mm->pgd); 563 566 spin_unlock(&mm->page_table_lock); 564 567 }