Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp6346329pxb; Mon, 8 Nov 2021 07:10:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJxGwg8Aepf/cNDqKKuYT3rbQL2WL29DdQ8ggIC14QedsEvnGL35l5xC12itmUV1rUTl+aFQ X-Received: by 2002:a17:906:9941:: with SMTP id zm1mr18784ejb.466.1636384219480; Mon, 08 Nov 2021 07:10:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636384219; cv=none; d=google.com; s=arc-20160816; b=G+oNSitcCjMeAzT4/ukj46SWos191SLC0MQqYGQ9hvWjjUOEH8ez6ubt9XcUHfWay2 6a+7WGRj5L6X0Tz77KfbyYpOjIIf++Z/sEkCi/lNdy6qikEL0d10eEEMCxjWcbdMlygl LErMtR6R0PCiWJ6Ey4vDY96jXfcRK7cuE5JCKe3Et34qfI85ajVDqhuGYHqXVk0GH/u3 JjPTmfye8u9yMrUw/qXt8+nrzjvsA9EcMRdElrc5N+bBmSqagVsgk7dWvJOuJ13ER6Im xIFxlYU2PjaA3l4iAqmdsWYB8GBTcN5t1+3eJSPQSjGw7fKQGg8keQBuLYfDBS80yucV oivw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=PzOPuLscGxVueOEHDmBojbj7Lh0Tq2B/QQr/AISfS/c=; b=C7p/b9EVDl3yEdPjVlMS7HoZnivOcDkb1PvEUhYvAYmsRfX+XY6IP1FSJT1n86jPh8 MZiqxaNQzaVRFesGaEhGPY0E9xLVAKYzRLSaRusO6zUvYWkFRXbqP1N9+EhlbWFdE/ur capMnCxuuTSxJysdRKLjazNs56zlWjTZoT+BXjsBR0bYJW9f/pbBvSoi93xKwIMen9dR K3q7kju5FeAtmpIZm6UssF0CVjsBaslRZKsfog8/LLO6hCNHt9WUlyKIoaM1vIlLZaqQ FfrnUN9Xk92LTfg1G4jdPFdw97ge8H3R1SWoK3stpcpExSj3GwGvc4LaoPaaSepPf4T/ 54UA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=qtAqqdfn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x18si23251553ejd.405.2021.11.08.07.09.53; Mon, 08 Nov 2021 07:10:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=qtAqqdfn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238917AbhKHKR6 (ORCPT + 99 others); Mon, 8 Nov 2021 05:17:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238595AbhKHKPU (ORCPT ); Mon, 8 Nov 2021 05:15:20 -0500 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39F46C061208 for ; Mon, 8 Nov 2021 02:12:29 -0800 (PST) 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 CE3381EC0505; Mon, 8 Nov 2021 11:12:27 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1636366347; 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=PzOPuLscGxVueOEHDmBojbj7Lh0Tq2B/QQr/AISfS/c=; b=qtAqqdfn1THtPBwyPZBq12j9u2vAbZjxAt+6yxyE6OsirMpQ47UK4gYN2Hdp58Xs7J05iN bh8/xOqrOsNaoECN9NUk8rTbTEwlObG73wNNX5+feEHN8t6ey1S5Lbq0smyNfQ8aH18olT eyPeR84afp74lzjxI/CpNOdws01/YgY= From: Borislav Petkov To: LKML Cc: linux-um@lists.infradead.org Subject: [PATCH v0 25/42] arch/um: Check notifier registration return value Date: Mon, 8 Nov 2021 11:11:40 +0100 Message-Id: <20211108101157.15189-26-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 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Borislav Petkov Avoid homegrown notifier registration checks. No functional changes. Signed-off-by: Borislav Petkov Cc: linux-um@lists.infradead.org --- arch/um/drivers/mconsole_kern.c | 6 ++++-- arch/um/kernel/um_arch.c | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/arch/um/drivers/mconsole_kern.c b/arch/um/drivers/mconsole_kern.c index 6ead1e240457..ceea940c0aa0 100644 --- a/arch/um/drivers/mconsole_kern.c +++ b/arch/um/drivers/mconsole_kern.c @@ -856,8 +856,10 @@ static struct notifier_block panic_exit_notifier = { static int add_notifier(void) { - atomic_notifier_chain_register(&panic_notifier_list, - &panic_exit_notifier); + if (atomic_notifier_chain_register(&panic_notifier_list, + &panic_exit_notifier)) + pr_warn("UM console panic notifier already registered\n"); + return 0; } diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c index 54447690de11..6c0e562ff0b7 100644 --- a/arch/um/kernel/um_arch.c +++ b/arch/um/kernel/um_arch.c @@ -255,8 +255,9 @@ static struct notifier_block panic_exit_notifier = { void uml_finishsetup(void) { - atomic_notifier_chain_register(&panic_notifier_list, - &panic_exit_notifier); + if (atomic_notifier_chain_register(&panic_notifier_list, + &panic_exit_notifier)) + pr_warn("UM panic notifier already registered\n"); uml_postsetup(); -- 2.29.2