Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2719888imj; Mon, 11 Feb 2019 07:28:52 -0800 (PST) X-Google-Smtp-Source: AHgI3IasQQPMVVk6oFrYtRheg4Zbtk5JOAgQDodw2CdFmjf5F10Mxrd7bGWlgbQt22Ka+DF+fq5h X-Received: by 2002:a63:7909:: with SMTP id u9mr8228386pgc.243.1549898932359; Mon, 11 Feb 2019 07:28:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549898932; cv=none; d=google.com; s=arc-20160816; b=fmNso3R5Vp+JO+5VY8EB9XotiQvpcNpC5AhCRFOcVjd9XGWNRLoEOdB6WXxIOuWxgI uQpAvNkyoUitZCZ7ayASKdv6uY48VYtGFQBhkPfWM+XLMgmPRz7q007qAaX4ghVEfKNW HzjDrfbDXqxmyAg0f1HXwRiW3efGnniyo51WEgl7RkKUQXKJ2JwYCOw3II57RCv8OxkH IM2c4FLogA87CnwjWZmb2qLatobSLPtDiy1ndJtXfI5j2Qg+E3LLZXyuarCGa/BbI5nr wRqM6jWdA24krpiC5Qy5aPHaA8U0TV8MVw2nx82ykA81pLXyolDfS29tY/fbvdSVzrZb Jv3g== 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=X1gm+bHY8mvE73rnFApyByiiiKkV7P3xq+MbSFMV80Q=; b=WnjfIYPAIPCFYI3ObZL/q84L4Ijma3Nssed3CyBnBj/m9XVlzMLa38RZQwt2a8uyeH 05pgfAritNKhlMBdnQJdqAholrPGdJ/MdicFl4QcfBvPM1lRroWPZ8ZCaNp+oTOATvMr pFiBBqd1U2YEvfjAq3qBRxrpVymTFbqKSrU5FaTHRVnt0uOVxF6uqKHzbDBUaPYx3NZm UpMCDCFhLwgUx0OYK/46Qu0PTLaNC0XCTiI2eKDznfwNVjgCs5D4NaBjp9aZxz7h7hQi iwvfksgIuaDKebVKBGg5e8DvreCsFcbIriOkP1ch9KtvL/NKbbSxeqfUM2WUBpRiT0E9 7Z3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ywZs5ZX9; 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 l15si9035629pff.206.2019.02.11.07.28.35; Mon, 11 Feb 2019 07:28:52 -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=ywZs5ZX9; 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 S2389718AbfBKO7G (ORCPT + 99 others); Mon, 11 Feb 2019 09:59:06 -0500 Received: from mail.kernel.org ([198.145.29.99]:46790 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389707AbfBKO7C (ORCPT ); Mon, 11 Feb 2019 09:59:02 -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 78910206BA; Mon, 11 Feb 2019 14:59:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549897141; bh=hsFEGzcJS1SFrsJt9O8/bw3i0ZuHEEdLeGmnkcS6R10=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ywZs5ZX90yOlO2px2unj8cQAU1h+zfReAF2jUBdoZrGJrI0rnOyT06/AM8TrsTYXv jHiDrP1x0pkW0E1ypuODCwLTzfnU4MAN5WkVh3WexIu6pivxI1dDD18qNoKOdSMFVw Qr7x041b6JNGfLn+tyOXLxUoIbycs5YKX3Tnu2OQ= 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.14 104/205] KVM: s390: unregister debug feature on failing arch init Date: Mon, 11 Feb 2019 15:18:22 +0100 Message-Id: <20190211141835.369942513@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141827.214852402@linuxfoundation.org> References: <20190211141827.214852402@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.14-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 4f6adbea592b..f674a81c8868 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c @@ -361,19 +361,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