summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRadim Krčmář <rkrcmar@redhat.com>2017-04-06 14:41:39 +0200
committerRadim Krčmář <rkrcmar@redhat.com>2017-04-06 14:41:39 +0200
commit8786fa667a2b3dd263868dd09142937bd207520f (patch)
tree074ab31d87f6eda916f6b2819e807f57aca53b4f
parent6fd6410311d618d80748b0a5dd3e8d6cd17662bc (diff)
parentabd80dcbc400fac878202136645e9acf0e0bfbd9 (diff)
downloadlinux-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.c4
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);