summaryrefslogtreecommitdiff
path: root/drivers/net/team/team_mode_activebackup.c
diff options
context:
space:
mode:
authorJiri Pirko <jpirko@redhat.com>2011-11-16 11:09:09 +0000
committerDavid S. Miller <davem@davemloft.net>2011-11-16 18:16:38 -0500
commit358b838291f618278080bbed435b755f9b46748e (patch)
treeb8203f872977fff505fcb8b1c7ce44deace9690b /drivers/net/team/team_mode_activebackup.c
parent61dc3461b9549bc10a2f16d254250680cadafcce (diff)
team: replicate options on register
Since multiple team instances are putting defined options into their option list, during register each option must be cloned before added into list. This resolves uncool memory corruptions when using multiple teams. Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/team/team_mode_activebackup.c')
-rw-r--r--drivers/net/team/team_mode_activebackup.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/net/team/team_mode_activebackup.c b/drivers/net/team/team_mode_activebackup.c
index 6fe920c440b3..b34427502b54 100644
--- a/drivers/net/team/team_mode_activebackup.c
+++ b/drivers/net/team/team_mode_activebackup.c
@@ -83,7 +83,7 @@ static int ab_active_port_set(struct team *team, void *arg)
return -ENOENT;
}
-static struct team_option ab_options[] = {
+static const struct team_option ab_options[] = {
{
.name = "activeport",
.type = TEAM_OPTION_TYPE_U32,
@@ -94,8 +94,7 @@ static struct team_option ab_options[] = {
int ab_init(struct team *team)
{
- team_options_register(team, ab_options, ARRAY_SIZE(ab_options));
- return 0;
+ return team_options_register(team, ab_options, ARRAY_SIZE(ab_options));
}
void ab_exit(struct team *team)