[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <129beb0a860102ba7970ab7497a5a83fe2041e68.camel@sipsolutions.net>
Date: Mon, 08 Nov 2021 11:23:59 +0100
From: Johannes Berg <johannes@...solutions.net>
To: Borislav Petkov <bp@...en8.de>, LKML <linux-kernel@...r.kernel.org>
Cc: linux-um@...ts.infradead.org
Subject: Re: [PATCH v0 25/42] arch/um: Check notifier registration return
value
On Mon, 2021-11-08 at 11:11 +0100, Borislav Petkov wrote:
> From: Borislav Petkov <bp@...e.de>
>
> Avoid homegrown notifier registration checks.
>
> No functional changes.
>
> Signed-off-by: Borislav Petkov <bp@...e.de>
> Cc: linux-um@...ts.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;
Maybe it should just return it? I don't see how this is ever possible,
since it's an initcall.
johannes
Powered by blists - more mailing lists