|
[PATCH 8/8] KVM: Fix oops on oom: msg#00251emulators.kvm.devel
__free_page() doesn't like a NULL argument, so check before calling it. A NULL can only happen if memory is exhausted during allocation of a memory slot. Signed-off-by: Avi Kivity <avi@xxxxxxxxxxxx> Index: linux-2.6/drivers/kvm/kvm_main.c =================================================================== --- linux-2.6.orig/drivers/kvm/kvm_main.c +++ linux-2.6/drivers/kvm/kvm_main.c @@ -245,7 +245,8 @@ static void kvm_free_physmem_slot(struct if (!dont || free->phys_mem != dont->phys_mem) if (free->phys_mem) { for (i = 0; i < free->npages; ++i) - __free_page(free->phys_mem[i]); + if (free->phys_mem[i]) + __free_page(free->phys_mem[i]); vfree(free->phys_mem); } ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | [PATCH 7/8] KVM: Rename some msrs: 00251, Avi Kivity |
|---|---|
| Next by Date: | Re: [PATCH 0/8] KVM updates for 2.6.20-rc2: 00251, Ingo Molnar |
| Previous by Thread: | [PATCH 7/8] KVM: Rename some msrsi: 00251, Avi Kivity |
| Next by Thread: | Re: [PATCH 0/8] KVM updates for 2.6.20-rc2: 00251, Ingo Molnar |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |