diff options
author | Radim Krčmář <rkrcmar@redhat.com> | 2017-04-06 14:41:39 +0200 |
---|---|---|
committer | Radim Krčmář <rkrcmar@redhat.com> | 2017-04-06 14:41:39 +0200 |
commit | 8786fa667a2b3dd263868dd09142937bd207520f (patch) | |
tree | 074ab31d87f6eda916f6b2819e807f57aca53b4f | |
parent | 6fd6410311d618d80748b0a5dd3e8d6cd17662bc (diff) | |
parent | abd80dcbc400fac878202136645e9acf0e0bfbd9 (diff) | |
download | linux-8786fa667a2b3dd263868dd09142937bd207520f.tar.bz2 |
Merge branch 'kvm-ppc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
From: Paul Mackerras <paulus@ozlabs.org>
A check for a NULL return from kzalloc in recently-added code.
-rw-r--r-- | arch/powerpc/kvm/book3s_64_mmu_hv.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/powerpc/kvm/book3s_64_mmu_hv.c b/arch/powerpc/kvm/book3s_64_mmu_hv.c index 8c68145ba1bd..710e491206ed 100644 --- a/arch/powerpc/kvm/book3s_64_mmu_hv.c +++ b/arch/powerpc/kvm/book3s_64_mmu_hv.c @@ -1487,6 +1487,10 @@ long kvm_vm_ioctl_resize_hpt_prepare(struct kvm *kvm, /* start new resize */ resize = kzalloc(sizeof(*resize), GFP_KERNEL); + if (!resize) { + ret = -ENOMEM; + goto out; + } resize->order = shift; resize->kvm = kvm; INIT_WORK(&resize->work, resize_hpt_prepare_work); |