linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: andre.przywara@arm.com (Andre Przywara)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm/arm64: KVM: fix missing unlock on error in kvm_vgic_create()
Date: Fri, 27 Feb 2015 12:07:51 +0000	[thread overview]
Message-ID: <54F05E17.9090904@arm.com> (raw)
In-Reply-To: <1425037305-23292-1-git-send-email-weiyj_lk@163.com>

Hi Wei,

On 27/02/15 11:41, weiyj_lk at 163.com wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> Add the missing unlock before return from function kvm_vgic_create()
> in the error handling case.
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> ---
>  virt/kvm/arm/vgic.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c
> index 0cc6ab6..4b2c2e7 100644
> --- a/virt/kvm/arm/vgic.c
> +++ b/virt/kvm/arm/vgic.c
> @@ -1583,8 +1583,10 @@ int kvm_vgic_create(struct kvm *kvm, u32 type)
>  	 * emulation. So check this here again. KVM_CREATE_DEVICE does
>  	 * the proper checks already.
>  	 */
> -	if (type == KVM_DEV_TYPE_ARM_VGIC_V2 && !vgic->can_emulate_gicv2)
> -		return -ENODEV;
> +	if (type == KVM_DEV_TYPE_ARM_VGIC_V2 && !vgic->can_emulate_gicv2) {
> +		ret = -ENODEV;
> +		goto out;
> +	}

Ah, good catch. Embarrassing that that could slip through ...


Acked-by: Andre Przywara <andre.przywara@arm.com>


Out of curiosity: did you see it hang or was this just by looking at the
code? I thought that I tested this case ...

Cheers,
Andre.

  reply	other threads:[~2015-02-27 12:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-27 11:41 [PATCH] arm/arm64: KVM: fix missing unlock on error in kvm_vgic_create() weiyj_lk at 163.com
2015-02-27 12:07 ` Andre Przywara [this message]
2015-03-02 17:29 ` Christoffer Dall
2015-03-13 10:24   ` Andre Przywara
2015-03-13 10:41     ` Christoffer Dall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54F05E17.9090904@arm.com \
    --to=andre.przywara@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).