From patchwork Mon Nov 8 10:11:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Borislav Petkov X-Patchwork-Id: 12608163 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2D889C433F5 for ; Mon, 8 Nov 2021 10:15:09 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E9FC761207 for ; Mon, 8 Nov 2021 10:15:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E9FC761207 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=alien8.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=n5V8ne4tu0DHTh+9g4K4kskNVahEeFnV71H38a2t+ns=; b=i/pALXBGgWmTPo CC8BQSQTentGGIpAJwHlWB+tcFA8SCCNGqQgbRXDuD/IeMlxf0eGY6fBkD96s445DbkSaTxY6ScUn MdtC0nfcSoBjmDF/NBaNT8K2H8Jvg0GfLWpqp8nM7+tVjkeFqROahrn9wHCLcHwoi6MXWyya2QdgG A/HCFRL8ynjG74eZUhTQh1MCI3YwZ4XAcPvmvTvXppbl+Q6Q5fZcGXY2PDEMHvCYZkGRsYLpT/rrU 9hpel/katwFCjIvlorIbUlUdb+JhgKTfwDYpnMug6MaQ7f6EzBThortkEsF1xwWViIZQQ0Uj958o4 iKw7laRBX3h0FNumUNlA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mk1dk-00FyxO-KL; Mon, 08 Nov 2021 10:12:36 +0000 Received: from mail.skyhub.de ([2a01:4f8:190:11c2::b:1457]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mk1dg-00FywL-HR for linux-arm-kernel@lists.infradead.org; Mon, 08 Nov 2021 10:12:33 +0000 Received: from zn.tnic (p200300ec2f33110088892b77bd117736.dip0.t-ipconnect.de [IPv6:2003:ec:2f33:1100:8889:2b77:bd11:7736]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 117821EC051F; Mon, 8 Nov 2021 11:12:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1636366351; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZrcRCvECKj7IKUT0HhuHkcjgG9gjdsthfkW1xcjqiQQ=; b=Bry7kjH/QPnC8+/1Xd35kNkpMnozd5dqVjBxpEJhFQos8IwQXvKbX5GfwlRbJOwjjNWHuN cy1YdUgsC+vuiCb5tv2y4EgPfGNdUovYo7RznunEwaImVg/xycVcfO6RgLRcz+j5NLy4aZ ttYPmlYm9OJYwZrmbpqI/hS5S/0F8RQ= From: Borislav Petkov To: LKML Cc: linux-arm-kernel@lists.infradead.org Subject: [PATCH v0 29/42] arm64: Check notifier registration return value Date: Mon, 8 Nov 2021 11:11:44 +0100 Message-Id: <20211108101157.15189-30-bp@alien8.de> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20211108101157.15189-1-bp@alien8.de> References: <20211108101157.15189-1-bp@alien8.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211108_021232_760405_AF4F33C4 X-CRM114-Status: GOOD ( 12.16 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Borislav Petkov Avoid homegrown notifier registration checks. No functional changes. Signed-off-by: Borislav Petkov Cc: linux-arm-kernel@lists.infradead.org --- arch/arm64/kernel/setup.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c index be5f85b0a24d..e66af9de7cd7 100644 --- a/arch/arm64/kernel/setup.c +++ b/arch/arm64/kernel/setup.c @@ -440,8 +440,10 @@ static struct notifier_block arm64_panic_block = { static int __init register_arm64_panic_block(void) { - atomic_notifier_chain_register(&panic_notifier_list, - &arm64_panic_block); + if (atomic_notifier_chain_register(&panic_notifier_list, + &arm64_panic_block)) + pr_warn("Panic notifier already registered\n"); + return 0; } device_initcall(register_arm64_panic_block);