public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
From: Christian Borntraeger <borntraeger@de.ibm.com>
To: Janosch Frank <frankja@linux.ibm.com>, kvm@vger.kernel.org
Cc: linux-s390@vger.kernel.org, david@redhat.com
Subject: Re: [PATCH] KVM: s390: Cleanup kvm_arch_init error path
Date: Wed, 2 Oct 2019 20:32:55 +0200	[thread overview]
Message-ID: <44b07ac3-1ff3-5524-fe6a-4ddc87ee130b@de.ibm.com> (raw)
In-Reply-To: <20191002075627.3582-1-frankja@linux.ibm.com>



On 02.10.19 09:56, Janosch Frank wrote:
> Both kvm_s390_gib_destroy and debug_unregister test if the needed
> pointers are not NULL and hence can be called unconditionally.
> 
> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>

Thanks applied.

> ---
>  arch/s390/kvm/kvm-s390.c | 18 +++++++-----------
>  1 file changed, 7 insertions(+), 11 deletions(-)
> 
> diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
> index 895fb2006c0d..66720d69cd24 100644
> --- a/arch/s390/kvm/kvm-s390.c
> +++ b/arch/s390/kvm/kvm-s390.c
> @@ -458,16 +458,14 @@ static void kvm_s390_cpu_feat_init(void)
>  
>  int kvm_arch_init(void *opaque)
>  {
> -	int rc;
> +	int rc = -ENOMEM;
>  
>  	kvm_s390_dbf = debug_register("kvm-trace", 32, 1, 7 * sizeof(long));
>  	if (!kvm_s390_dbf)
>  		return -ENOMEM;
>  
> -	if (debug_register_view(kvm_s390_dbf, &debug_sprintf_view)) {
> -		rc = -ENOMEM;
> -		goto out_debug_unreg;
> -	}
> +	if (debug_register_view(kvm_s390_dbf, &debug_sprintf_view))
> +		goto out;
>  
>  	kvm_s390_cpu_feat_init();
>  
> @@ -475,19 +473,17 @@ int kvm_arch_init(void *opaque)
>  	rc = kvm_register_device_ops(&kvm_flic_ops, KVM_DEV_TYPE_FLIC);
>  	if (rc) {
>  		pr_err("A FLIC registration call failed with rc=%d\n", rc);
> -		goto out_debug_unreg;
> +		goto out;
>  	}
>  
>  	rc = kvm_s390_gib_init(GAL_ISC);
>  	if (rc)
> -		goto out_gib_destroy;
> +		goto out;
>  
>  	return 0;
>  
> -out_gib_destroy:
> -	kvm_s390_gib_destroy();
> -out_debug_unreg:
> -	debug_unregister(kvm_s390_dbf);
> +out:
> +	kvm_arch_exit();
>  	return rc;
>  }
>  
> 

      parent reply	other threads:[~2019-10-02 18:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-02  7:56 [PATCH] KVM: s390: Cleanup kvm_arch_init error path Janosch Frank
2019-10-02  8:01 ` David Hildenbrand
2019-10-02  8:07   ` Thomas Huth
2019-10-02  8:20     ` David Hildenbrand
2019-10-02 10:45       ` Christian Borntraeger
2019-10-02 18:21         ` David Hildenbrand
2019-10-02 18:32 ` Christian Borntraeger [this message]

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=44b07ac3-1ff3-5524-fe6a-4ddc87ee130b@de.ibm.com \
    --to=borntraeger@de.ibm.com \
    --cc=david@redhat.com \
    --cc=frankja@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-s390@vger.kernel.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