netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: YueHaibing <yuehaibing@huawei.com>,
	Jakub Kicinski <jakub.kicinski@netronome.com>,
	Sasha Levin <sashal@kernel.org>,
	netdev@vger.kernel.org
Subject: [PATCH AUTOSEL 4.9 12/21] act_mirred: Fix mirred_init_module error handling
Date: Sat, 26 Oct 2019 09:22:08 -0400	[thread overview]
Message-ID: <20191026132217.4380-12-sashal@kernel.org> (raw)
In-Reply-To: <20191026132217.4380-1-sashal@kernel.org>

From: YueHaibing <yuehaibing@huawei.com>

[ Upstream commit 11c9a7d38af524217efb7a176ad322b97ac2f163 ]

If tcf_register_action failed, mirred_device_notifier
should be unregistered.

Fixes: 3b87956ea645 ("net sched: fix race in mirred device removal")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/sched/act_mirred.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c
index fc3650b061924..9b4c7c42c932d 100644
--- a/net/sched/act_mirred.c
+++ b/net/sched/act_mirred.c
@@ -332,7 +332,11 @@ static int __init mirred_init_module(void)
 		return err;
 
 	pr_info("Mirror/redirect action on\n");
-	return tcf_register_action(&act_mirred_ops, &mirred_net_ops);
+	err = tcf_register_action(&act_mirred_ops, &mirred_net_ops);
+	if (err)
+		unregister_netdevice_notifier(&mirred_device_notifier);
+
+	return err;
 }
 
 static void __exit mirred_cleanup_module(void)
-- 
2.20.1


  parent reply	other threads:[~2019-10-26 13:22 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20191026132217.4380-1-sashal@kernel.org>
2019-10-26 13:21 ` [PATCH AUTOSEL 4.9 02/21] mac80211_hwsim: fix incorrect dev_alloc_name failure goto Sasha Levin
2019-10-26 13:22 ` [PATCH AUTOSEL 4.9 04/21] net: stmmac: gmac4+: Not all Unicast addresses may be available Sasha Levin
2019-10-26 13:22 ` [PATCH AUTOSEL 4.9 05/21] mac80211: accept deauth frames in IBSS mode Sasha Levin
2019-10-26 13:22 ` [PATCH AUTOSEL 4.9 06/21] llc: fix sk_buff leak in llc_sap_state_process() Sasha Levin
2019-10-26 13:22 ` [PATCH AUTOSEL 4.9 07/21] llc: fix sk_buff leak in llc_conn_service() Sasha Levin
2019-10-26 13:22 ` [PATCH AUTOSEL 4.9 08/21] llc: fix another potential sk_buff leak in llc_ui_sendmsg() Sasha Levin
2019-10-26 13:22 ` [PATCH AUTOSEL 4.9 09/21] llc: fix sk_buff refcounting in llc_conn_state_process() Sasha Levin
2019-10-26 13:22 ` [PATCH AUTOSEL 4.9 10/21] net: stmmac: fix length of PTP clock's name string Sasha Levin
2019-10-26 13:22 ` [PATCH AUTOSEL 4.9 11/21] bonding: fix potential NULL deref in bond_update_slave_arr Sasha Levin
2019-10-26 13:22 ` Sasha Levin [this message]
2019-10-26 13:22 ` [PATCH AUTOSEL 4.9 13/21] net: usb: qmi_wwan: add Telit 0x1050 composition Sasha Levin
2019-10-26 13:22 ` [PATCH AUTOSEL 4.9 17/21] net: bcmgenet: Fix RGMII_MODE_EN value for GENET v1/2/3 Sasha Levin
2019-10-26 13:22 ` [PATCH AUTOSEL 4.9 18/21] net: usb: sr9800: fix uninitialized local variable Sasha Levin
2019-10-26 13:22 ` [PATCH AUTOSEL 4.9 19/21] usb: hso: obey DMA rules in tiocmget Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191026132217.4380-12-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=jakub.kicinski@netronome.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=yuehaibing@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).