Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2759422imj; Mon, 11 Feb 2019 08:04:23 -0800 (PST) X-Google-Smtp-Source: AHgI3IY0xTiESXXPdYi4zHycbawnj8rewPIViagfSey6ktj42hvi8FHvOsoNfbePiHU62nvgjvD6 X-Received: by 2002:a62:59d0:: with SMTP id k77mr13139638pfj.211.1549901063727; Mon, 11 Feb 2019 08:04:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549901063; cv=none; d=google.com; s=arc-20160816; b=rkBHApVd++ZA8B3GjKsvhpZPh8QIWU2wMicFYFiZlULifbLKZh5CUQ9GyHBlaOIChF pYsAsDaLsHHD/URsCYiuNPnWeNZeiWh1VT0BKlgB+J2DfIv1n0pdixl/RKKm8jii6rF/ eNOHzl4U47WVjUlRLyNlIIO8Lf95dHJKTTtphOfPWxAOQeuZ4wvjAM+TyID7vn/o6cfO 4LnGYJnKM+kOVD9CnEPX7UuDj2c4gPeD4daLx67HLM47yTPPCelhxVerBXXW1mro4Fo/ qUNLXRqMMk2luUixgLgB2rtSoZAFw93z2UI/XEkd+lCONMQrYxuthMTcrj8jFg3O+QTE mgjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=TIZ1vMN6FCmDj6tAr9dLCoYfaF4MG+MTulPE+oBcGFY=; b=il8A4wVAkWfuHEOBercfML+ucUodNHBGAo8YKR6pjXRB+V7Bg+SzZbrTcemhCSWhmr i2ZYMMOb0UPMX/4xLjm+F0VFMi5/AXJYpqYjb9LVnJXwcmLqvWZKP1jnjjcolTfHeUxa 2huIbk+0sxdPfcMF192hz8f4UCw2tJf0BT1aNXhnu5JVfayrfRa01+bMN4XOUQfRDNic Uko/2+fXQVOUSp+Yw5RkozDDTRkoW8NnCQcaRELMRVAW5p+24Pj/97WjY2U+RE/f1OkF TIAYCzX/TYYvGa+vketGupFqbsAya8+QsbDEjwf5C8EqkdDXtrX99bm/7X+zNUwgWqwS 4TJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0jtzYAWB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q19si9474416pgv.436.2019.02.11.08.04.00; Mon, 11 Feb 2019 08:04:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0jtzYAWB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730067AbfBKOaH (ORCPT + 99 others); Mon, 11 Feb 2019 09:30:07 -0500 Received: from mail.kernel.org ([198.145.29.99]:36208 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730052AbfBKOaA (ORCPT ); Mon, 11 Feb 2019 09:30:00 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A4D522082F; Mon, 11 Feb 2019 14:29:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549895400; bh=Axski/CQBtUXLv6c4r9oDW4cqj5ZI+Kiw2Q3/N6jqEU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0jtzYAWB/eXccAGHZQaiDa/bsIPWp6WsL2/v567kSJNB5/OMM7EU1WXtTSQ9C0Y9K NBr/5sVQ78bsP/NX6BogMBnPWGc0Wep22ifhVdI8feI6Ju2fVLRX/o8fDpVC8doXRr A6iGC+wcTYgr6cl00eSjljaQAc0U7y2DJCkerlRI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Mueller , Cornelia Huck , Pierre Morel , David Hildenbrand , Christian Borntraeger , Sasha Levin Subject: [PATCH 4.20 193/352] KVM: s390: unregister debug feature on failing arch init Date: Mon, 11 Feb 2019 15:17:00 +0100 Message-Id: <20190211141859.386277295@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141846.543045703@linuxfoundation.org> References: <20190211141846.543045703@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Reviewed-by: Cornelia Huck Reviewed-by: Pierre Morel Reviewed-by: David Hildenbrand Message-Id: <20181130143215.69496-2-mimu@linux.ibm.com> Signed-off-by: Christian Borntraeger Signed-off-by: Sasha Levin --- 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) -- 2.19.1