public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, idosch@mellanox.com, eladr@mellanox.com,
	yotamg@mellanox.com, ogerlitz@mellanox.com, j.vosburgh@gmail.com,
	vfalico@gmail.com, gospo@cumulusnetworks.com,
	dsa@cumulusnetworks.com, nikolay@cumulusnetworks.com,
	pjonnala@broadcom.com, f.fainelli@gmail.com, sfeldma@gmail.com,
	john.fastabend@gmail.com, roopa@cumulusnetworks.com,
	andrew@lunn.ch
Subject: [patch net-next v3 15/28] team: rtnl_lock for options set
Date: Thu,  3 Dec 2015 12:12:17 +0100	[thread overview]
Message-ID: <1449141150-8172-16-git-send-email-jiri@resnulli.us> (raw)
In-Reply-To: <1449141150-8172-1-git-send-email-jiri@resnulli.us>

From: Jiri Pirko <jiri@mellanox.com>

During options set, there will be needed to hold rtnl_mutex in order to
safely call netdev notifiers.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
 drivers/net/team/team.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
index dd1504b..9814133 100644
--- a/drivers/net/team/team.c
+++ b/drivers/net/team/team.c
@@ -2422,9 +2422,13 @@ static int team_nl_cmd_options_set(struct sk_buff *skb, struct genl_info *info)
 	struct nlattr *nl_option;
 	LIST_HEAD(opt_inst_list);
 
+	rtnl_lock();
+
 	team = team_nl_team_get(info);
-	if (!team)
-		return -EINVAL;
+	if (!team) {
+		err = -EINVAL;
+		goto rtnl_unlock;
+	}
 
 	err = -EINVAL;
 	if (!info->attrs[TEAM_ATTR_LIST_OPTION]) {
@@ -2551,7 +2555,8 @@ static int team_nl_cmd_options_set(struct sk_buff *skb, struct genl_info *info)
 
 team_put:
 	team_nl_team_put(team);
-
+rtnl_unlock:
+	rtnl_unlock();
 	return err;
 }
 
-- 
1.9.3

  parent reply	other threads:[~2015-12-03 11:12 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-03 11:12 [patch net-next v3 00/28] bonding/team offload + mlxsw implementation Jiri Pirko
2015-12-03 11:12 ` [patch net-next v3 01/28] net: Check CHANGEUPPER notifier return value Jiri Pirko
2015-12-03 11:12 ` [patch net-next v3 02/28] net: Add support for CHANGEUPPER notifier error injection Jiri Pirko
2015-12-03 11:12 ` [patch net-next v3 03/28] bonding: add 802.3ad support for 100G speeds Jiri Pirko
2015-12-03 11:12 ` [patch net-next v3 04/28] net: add netif_is_team_master helper Jiri Pirko
2015-12-03 12:46   ` Eric Dumazet
2015-12-03 13:49     ` Jiri Pirko
2015-12-03 11:12 ` [patch net-next v3 05/28] net: add netif_is_team_port helper Jiri Pirko
2015-12-03 11:12 ` [patch net-next v3 06/28] net: add netif_is_lag_master helper Jiri Pirko
2015-12-03 11:12 ` [patch net-next v3 07/28] net: add netif_is_lag_port helper Jiri Pirko
2015-12-03 11:12 ` [patch net-next v3 08/28] net: propagate upper priv via netdev_master_upper_dev_link Jiri Pirko
2015-12-03 11:12 ` [patch net-next v3 09/28] net: add possibility to pass information about upper device via notifier Jiri Pirko
2015-12-03 11:12 ` [patch net-next v3 10/28] net: add info struct for LAG changeupper Jiri Pirko
2015-12-03 11:12 ` [patch net-next v3 11/28] team: fill-up LAG changeupper info struct and pass it along Jiri Pirko
2015-12-03 11:12 ` [patch net-next v3 12/28] bonding: " Jiri Pirko
2015-12-03 11:12 ` [patch net-next v3 13/28] net: introduce change lower state notifier Jiri Pirko
2015-12-03 11:12 ` [patch net-next v3 14/28] net: introduce lower state changed info structure for LAG lowers Jiri Pirko
2015-12-03 11:12 ` Jiri Pirko [this message]
2015-12-03 11:12 ` [patch net-next v3 16/28] team: implement lower state change propagation Jiri Pirko
2015-12-03 11:12 ` [patch net-next v3 17/28] bonding: allow notifications for bond_set_slave_link_state Jiri Pirko
2015-12-03 11:12 ` [patch net-next v3 18/28] bonding: implement lower state change propagation Jiri Pirko
2015-12-03 11:12 ` [patch net-next v3 19/28] bonding: set inactive flags on release Jiri Pirko
2015-12-03 11:12 ` [patch net-next v3 20/28] mlxsw: spectrum: Add set_rx_mode ndo stub Jiri Pirko
2015-12-03 11:12 ` [patch net-next v3 21/28] mlxsw: core: Add support for packets received from LAG port Jiri Pirko
2015-12-03 11:12 ` [patch net-next v3 22/28] mlxsw: pci: Implement LAG processing for received packets Jiri Pirko
2015-12-03 11:12 ` [patch net-next v3 23/28] mlxsw: reg: Add link aggregation configuration registers definitions Jiri Pirko
2015-12-03 11:12 ` [patch net-next v3 24/28] mlxsw: reg: Add definition of LAG unicast record for SFD register Jiri Pirko
2015-12-03 11:12 ` [patch net-next v3 25/28] mlxsw: reg: Add definition of LAG unicast record for SFN register Jiri Pirko
2015-12-03 11:12 ` [patch net-next v3 26/28] mlxsw: spectrum: Implement LAG port join/leave Jiri Pirko
2015-12-03 11:12 ` [patch net-next v3 27/28] mlxsw: spectrum: Implement FDB add/remove/dump for LAG Jiri Pirko
2015-12-03 11:12 ` [patch net-next v3 28/28] mlxsw: spectrum: Implement LAG tx enabled lower state change Jiri Pirko
2015-12-03 16:51 ` [patch net-next v3 00/28] bonding/team offload + mlxsw implementation David Miller
2015-12-03 16:54   ` Jiri Pirko

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=1449141150-8172-16-git-send-email-jiri@resnulli.us \
    --to=jiri@resnulli.us \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=dsa@cumulusnetworks.com \
    --cc=eladr@mellanox.com \
    --cc=f.fainelli@gmail.com \
    --cc=gospo@cumulusnetworks.com \
    --cc=idosch@mellanox.com \
    --cc=j.vosburgh@gmail.com \
    --cc=john.fastabend@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=nikolay@cumulusnetworks.com \
    --cc=ogerlitz@mellanox.com \
    --cc=pjonnala@broadcom.com \
    --cc=roopa@cumulusnetworks.com \
    --cc=sfeldma@gmail.com \
    --cc=vfalico@gmail.com \
    --cc=yotamg@mellanox.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