Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933046Ab0GAVBS (ORCPT ); Thu, 1 Jul 2010 17:01:18 -0400 Received: from kroah.org ([198.145.64.141]:47927 "EHLO coco.kroah.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932873Ab0GAUv0 (ORCPT ); Thu, 1 Jul 2010 16:51:26 -0400 X-Mailbox-Line: From gregkh@clark.site Thu Jul 1 10:34:39 2010 Message-Id: <20100701173439.036385150@clark.site> User-Agent: quilt/0.48-10.1 Date: Thu, 01 Jul 2010 10:35:31 -0700 From: Greg KH To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: stable-review@kernel.org, torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, Wei Yongjun , Carsten Otte , Avi Kivity Subject: [patch 145/164] KVM: s390: Fix possible memory leak of in kvm_arch_vcpu_create() In-Reply-To: <20100701175152.GA2135@kroah.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1340 Lines: 43 2.6.33-stable review patch. If anyone has any objections, please let me know. ------------------ From: Wei Yongjun This patch fixed possible memory leak in kvm_arch_vcpu_create() under s390, which would happen when kvm_arch_vcpu_create() fails. Signed-off-by: Wei Yongjun Acked-by: Carsten Otte Cc: stable@kernel.org Signed-off-by: Avi Kivity Signed-off-by: Greg Kroah-Hartman (cherry picked from commit 7b06bf2ffa15e119c7439ed0b024d44f66d7b605) --- arch/s390/kvm/kvm-s390.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c @@ -339,11 +339,13 @@ struct kvm_vcpu *kvm_arch_vcpu_create(st rc = kvm_vcpu_init(vcpu, kvm, id); if (rc) - goto out_free_cpu; + goto out_free_sie_block; VM_EVENT(kvm, 3, "create cpu %d at %p, sie block at %p", id, vcpu, vcpu->arch.sie_block); return vcpu; +out_free_sie_block: + free_page((unsigned long)(vcpu->arch.sie_block)); out_free_cpu: kfree(vcpu); out_nomem: -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/