From patchwork Tue Mar 9 06:37:53 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 84234 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o296aS6u029929 for ; Tue, 9 Mar 2010 06:36:28 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752031Ab0CIGg0 (ORCPT ); Tue, 9 Mar 2010 01:36:26 -0500 Received: from cn.fujitsu.com ([222.73.24.84]:64767 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1751526Ab0CIGgZ (ORCPT ); Tue, 9 Mar 2010 01:36:25 -0500 Received: from tang.cn.fujitsu.com (tang.cn.fujitsu.com [10.167.250.3]) by song.cn.fujitsu.com (Postfix) with ESMTP id A4D7C170091 for ; Tue, 9 Mar 2010 14:36:24 +0800 (CST) Received: from fnst.cn.fujitsu.com (tang.cn.fujitsu.com [127.0.0.1]) by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id o296ZIHW007835 for ; Tue, 9 Mar 2010 14:35:18 +0800 Received: from [10.167.141.76] (unknown [10.167.141.76]) by fnst.cn.fujitsu.com (Postfix) with ESMTPA id 1008BD48A5 for ; Tue, 9 Mar 2010 14:38:31 +0800 (CST) Message-ID: <4B95ECC1.4060700@cn.fujitsu.com> Date: Tue, 09 Mar 2010 14:37:53 +0800 From: Wei Yongjun User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: kvm@vger.kernel.org Subject: [PATCH] KVM: s390: Fix possible memory leak of in kvm_arch_vcpu_create() Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 09 Mar 2010 06:36:28 +0000 (UTC) diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index 8f09959..f07d65f 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c @@ -340,11 +340,13 @@ struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm, 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: