Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp6338141pxb; Mon, 8 Nov 2021 07:03:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJwnkZH/ASkLC7opYv5q/FrjBWqNOuPPuVXPhTdKXT8L1t4Iy3G7z0KJqeekIL4feTVJfght X-Received: by 2002:a05:6e02:178d:: with SMTP id y13mr463615ilu.0.1636383821087; Mon, 08 Nov 2021 07:03:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636383821; cv=none; d=google.com; s=arc-20160816; b=U+WU/9c7freWn0hcHKoPLMZ7HcOh5c5knS6Qolu2oEL3IqTwuh+H/yXxiVS0V4dgSf aAFsBXNq8qZm7bmNJ3aqdzUwdZn5VS9Aj3McNeJ5+ZY1jsdWus0Jojlhj5zMJi0gfn/b 7sd6ORgyGLXWq5MjzwwJhuu7dMTCJS5ezx8ZT3ebzLUnQ/wxwL6qHtOQPcaDVrtVKe/v KbTUDrs98sDyUlT5cOQeOH+KsUlq6ROkkvfg2S7puvmqofYHm/0PefLjp3CiFVqQ0MGV e3MacN8GAijHNYLy0cjCtJQx5ku0bfnhdVa4K6KpBjcIfT3GzejCievQuYJaYtO449AT lN9A== 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=81p4IKlZUJtfRfnIfPVwCEdhFh/UCrCf47nC2WuyJyI=; b=BGCbR9LwrWly0oNnLyNryIMaJFExs3AXeFhiV6a9E4l7fQ4pp2OERKZkTlyhPbqVKX 58rrxVzscWR5s4jXDZLrvAmREiJDe63Bq2XdQTeL6u8Yk5cz4IE4cIpoLuu4/YUNCbxR CVuHfazUsY5tRL9ElAQmyTYWv4zOJD/TTfzz0VO4yu/4d/ZA/cUiWQSAscAoDCwHI25g XY4hfRr8rBt8aQUYnCMTzscEgElpTJs2r2tXnyroBXOiDriCXITxPoYM3A7TRyiTMhf/ dT+yX/yIcrXdJQkAJ5fwGv9LeQYmCSVqu8iuhkzr4lPeYxrwfA/BmkPYgrkm7JkSUK3a /KjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b="hk/VQz6T"; 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 d1si38078770ilg.74.2021.11.08.07.03.25; Mon, 08 Nov 2021 07:03:41 -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="hk/VQz6T"; 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 S238832AbhKHKRS (ORCPT + 99 others); Mon, 8 Nov 2021 05:17:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238574AbhKHKPN (ORCPT ); Mon, 8 Nov 2021 05:15:13 -0500 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42E42C061714; Mon, 8 Nov 2021 02:12:26 -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 8B61B1EC0516; Mon, 8 Nov 2021 11:12:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1636366345; 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=81p4IKlZUJtfRfnIfPVwCEdhFh/UCrCf47nC2WuyJyI=; b=hk/VQz6TaLZ5BMhEiZkVv867QuxxYSUFl64uJ6A+1q39/ledBAMMCVtgeWcENM9g8qlIYX 65yMvc3jmxRQpS1GqB+pTpQOLRn6gdf0F2JS8zIWyokH/hWhK/vNgePGV0kJ2iE/jRl1x8 Mw4OhnKEFjN50AD+MrGOVZ5gLLz/Hxs= From: Borislav Petkov To: LKML Cc: netdev@vger.kernel.org Subject: [PATCH v0 22/42] net: fib_notifier: Check notifier registration return value Date: Mon, 8 Nov 2021 11:11:37 +0100 Message-Id: <20211108101157.15189-23-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: netdev@vger.kernel.org --- net/core/fib_notifier.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/core/fib_notifier.c b/net/core/fib_notifier.c index fc96259807b6..fa07d6a81ba0 100644 --- a/net/core/fib_notifier.c +++ b/net/core/fib_notifier.c @@ -86,7 +86,9 @@ static bool fib_dump_is_consistent(struct net *net, struct notifier_block *nb, { struct fib_notifier_net *fn_net = net_generic(net, fib_notifier_net_id); - atomic_notifier_chain_register(&fn_net->fib_chain, nb); + if (atomic_notifier_chain_register(&fn_net->fib_chain, nb)) + pr_warn("FIB notifier already registered\n"); + if (fib_seq == fib_seq_sum(net)) return true; atomic_notifier_chain_unregister(&fn_net->fib_chain, nb); -- 2.29.2