[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <2de995f3-bb44-4f01-e6d9-05b785371a82@de.ibm.com>
Date: Mon, 11 Feb 2019 15:34:20 +0100
From: Christian Borntraeger <borntraeger@...ibm.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-kernel@...r.kernel.org
Cc: stable@...r.kernel.org, Michael Mueller <mimu@...ux.ibm.com>,
Cornelia Huck <cohuck@...hat.com>,
Pierre Morel <pmorel@...ux.ibm.com>,
David Hildenbrand <david@...hat.com>,
Sasha Levin <sashal@...nel.org>
Subject: Re: [PATCH 4.20 193/352] KVM: s390: unregister debug feature on
failing arch init
On 11.02.2019 15:17, Greg Kroah-Hartman wrote:
> 4.20-stable review patch. If anyone has any objections, please let me know.
>
> ------------------
>
> [ Upstream commit 308c3e6673b012beecb96ef04cc65f4a0e7cdd99 ]
>
> Make sure the debug feature and its allocated resources get
> released upon unsuccessful architecture initialization.
>
> A related indication of the issue will be reported as kernel
> message.
>
> Signed-off-by: Michael Mueller <mimu@...ux.ibm.com>
> Reviewed-by: Cornelia Huck <cohuck@...hat.com>
> Reviewed-by: Pierre Morel <pmorel@...ux.ibm.com>
> Reviewed-by: David Hildenbrand <david@...hat.com>
> Message-Id: <20181130143215.69496-2-mimu@...ux.ibm.com>
> Signed-off-by: Christian Borntraeger <borntraeger@...ibm.com>
> Signed-off-by: Sasha Levin <sashal@...nel.org>
It does not hurt, but I explicitly did not cc stable for this patch as
kvm_register_device_ops only fails in case of a code error.
> ---
> arch/s390/kvm/kvm-s390.c | 17 ++++++++++++++---
> 1 file changed, 14 insertions(+), 3 deletions(-)
>
> diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
> index fe24150ff666..d8d8e0788157 100644
> --- a/arch/s390/kvm/kvm-s390.c
> +++ b/arch/s390/kvm/kvm-s390.c
> @@ -417,19 +417,30 @@ static void kvm_s390_cpu_feat_init(void)
>
> int kvm_arch_init(void *opaque)
> {
> + int rc;
> +
> 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)) {
> - debug_unregister(kvm_s390_dbf);
> - return -ENOMEM;
> + rc = -ENOMEM;
> + goto out_debug_unreg;
> }
>
> kvm_s390_cpu_feat_init();
>
> /* Register floating interrupt controller interface. */
> - return kvm_register_device_ops(&kvm_flic_ops, KVM_DEV_TYPE_FLIC);
> + rc = kvm_register_device_ops(&kvm_flic_ops, KVM_DEV_TYPE_FLIC);
> + if (rc) {
> + pr_err("Failed to register FLIC rc=%d\n", rc);
> + goto out_debug_unreg;
> + }
> + return 0;
> +
> +out_debug_unreg:
> + debug_unregister(kvm_s390_dbf);
> + return rc;
> }
>
> void kvm_arch_exit(void)
>
Powered by blists - more mailing lists