aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/team/team.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
index c48ef19cac13..064155d56bce 100644
--- a/drivers/net/team/team.c
+++ b/drivers/net/team/team.c
@@ -104,19 +104,15 @@ int team_options_register(struct team *team,
104 if (!dst_opts) 104 if (!dst_opts)
105 return -ENOMEM; 105 return -ENOMEM;
106 for (i = 0; i < option_count; i++, option++) { 106 for (i = 0; i < option_count; i++, option++) {
107 struct team_option *dst_opt;
108
109 if (__team_find_option(team, option->name)) { 107 if (__team_find_option(team, option->name)) {
110 err = -EEXIST; 108 err = -EEXIST;
111 goto rollback; 109 goto rollback;
112 } 110 }
113 dst_opt = kmalloc(sizeof(*option), GFP_KERNEL); 111 dst_opts[i] = kmemdup(option, sizeof(*option), GFP_KERNEL);
114 if (!dst_opt) { 112 if (!dst_opts[i]) {
115 err = -ENOMEM; 113 err = -ENOMEM;
116 goto rollback; 114 goto rollback;
117 } 115 }
118 memcpy(dst_opt, option, sizeof(*option));
119 dst_opts[i] = dst_opt;
120 } 116 }
121 117
122 for (i = 0; i < option_count; i++) 118 for (i = 0; i < option_count; i++)