Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp6017322ybc; Wed, 27 Nov 2019 13:28:51 -0800 (PST) X-Google-Smtp-Source: APXvYqyAwVXjqgBmxWGAdDGaZwQBvLhd7BzuNglH4Fuoafgjaj36JkLsyskGkwJC19LBmqdyK0UR X-Received: by 2002:a05:6402:716:: with SMTP id w22mr3562784edx.245.1574890130904; Wed, 27 Nov 2019 13:28:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574890130; cv=none; d=google.com; s=arc-20160816; b=ZxeWnzRiPEnbB3wEbJguVwWVvnenQe1Vc6AxuCoHgKXrYvSG47kEjCS+uxVwVJcaDp WnrSC0B9R3ADqQtmzu7eN1ttLB9AigY8ni5oblLlXj2OLcBAVZw3IYGxEIN3979HKXx8 FIQEDxqO+uuXDxQvhlBY1HP85xeXWkJNNt9QxpqoEl2AZv85c9K8wX2OSHCrp/GESL9B SjB+UG3WmJPaEUQezGNWIXnVZmG4AIW/G5+Q3F8rHVB0ya+TkOJ1PU5TTkJNNiXu44cI dMt4c/E5onc6XDwJR9Ipioc6s/+dNlfHLUR36xAJnbGHFyCkoQW6HstYndTFMWAXL6yY rItg== 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=fNO5G4e0fhRcJ9vy3MqFX3lFT6c6JTi53Zxe/sm/4iM=; b=UpRDt/jVxoCflstPmfE9adzT+Y/ZGsVEK2D+l26HWP3WyMmWLn9QlrGwDiFmWLwEMp 3FLvmqD1aqriso8wUMyWflL7lMERPV3zbLbZOKWSsUXmMj0zk8nrcK4AbB6hbzillI74 BI0kQOq4pUwClBE+pIOnlETXJUZj2/16CBjGF5WGkOm/zNMM4dNF/7CyQMnod2WEabjl 4ymDCYQFFXwlrDf9uUJM13CSZKAaYyh0P3XpRVH4oAMuBlKFxIKEVtDNSxL5tlaEY0pw 4Ej+RSwgR9Ne/BV2Js4RslCi6g54lBt3Fk6QBxs4ZIJpzhOrC0oMTzM5Tuv3sJ+HmYK9 eqSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0lMsjBLT; 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 gt1si1858342ejb.144.2019.11.27.13.28.27; Wed, 27 Nov 2019 13:28:50 -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=0lMsjBLT; 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 S1731131AbfK0V0A (ORCPT + 99 others); Wed, 27 Nov 2019 16:26:00 -0500 Received: from mail.kernel.org ([198.145.29.99]:53274 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730346AbfK0VBM (ORCPT ); Wed, 27 Nov 2019 16:01:12 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.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 D682A20862; Wed, 27 Nov 2019 21:01:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574888471; bh=gjuzvXyhWRsXKjSOSgKr4qFWVX5/LvmJynn27rqTZCU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0lMsjBLTmx0aMyM3NLD+f+oOrfQL829E+j3eD5dlK7mYXBP8ru+o/qJVwBu8AWWVZ 6WBX4T3jrJQsCll4o7L5hdHpQB5FJvVEOOfl+Bq8B32bLrUbHF80k/VoP8DIck8PYp Vidg9qlquS6l1Dove+sqUwDfhKy/i11TG2u90Oqk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thomas Richter , Hendrik Brueckner , Martin Schwidefsky , Sasha Levin Subject: [PATCH 4.19 104/306] s390/perf: Return error when debug_register fails Date: Wed, 27 Nov 2019 21:29:14 +0100 Message-Id: <20191127203122.960338178@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127203114.766709977@linuxfoundation.org> References: <20191127203114.766709977@linuxfoundation.org> User-Agent: quilt/0.66 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 From: Thomas Richter [ Upstream commit ec0c0bb489727de0d4dca6a00be6970ab8a3b30a ] Return an error when the function debug_register() fails allocating the debug handle. Also remove the registered debug handle when the initialization fails later on. Signed-off-by: Thomas Richter Reviewed-by: Hendrik Brueckner Signed-off-by: Martin Schwidefsky Signed-off-by: Sasha Levin --- arch/s390/kernel/perf_cpum_sf.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/s390/kernel/perf_cpum_sf.c b/arch/s390/kernel/perf_cpum_sf.c index 44404836e9d11..df92c2af99b69 100644 --- a/arch/s390/kernel/perf_cpum_sf.c +++ b/arch/s390/kernel/perf_cpum_sf.c @@ -2045,14 +2045,17 @@ static int __init init_cpum_sampling_pmu(void) } sfdbg = debug_register(KMSG_COMPONENT, 2, 1, 80); - if (!sfdbg) + if (!sfdbg) { pr_err("Registering for s390dbf failed\n"); + return -ENOMEM; + } debug_register_view(sfdbg, &debug_sprintf_view); err = register_external_irq(EXT_IRQ_MEASURE_ALERT, cpumf_measurement_alert); if (err) { pr_cpumsf_err(RS_INIT_FAILURE_ALRT); + debug_unregister(sfdbg); goto out; } @@ -2061,6 +2064,7 @@ static int __init init_cpum_sampling_pmu(void) pr_cpumsf_err(RS_INIT_FAILURE_PERF); unregister_external_irq(EXT_IRQ_MEASURE_ALERT, cpumf_measurement_alert); + debug_unregister(sfdbg); goto out; } -- 2.20.1