diff --git a/[refs] b/[refs] index 5f286b443876..08fa591c90af 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 234a8fd49d086f5a3debb379bfdf4e6b51f0c0e2 +refs/heads/master: 2bba19fff8d09bf19df5d5e2de7188d65de67c3e diff --git a/trunk/drivers/net/team/team.c b/trunk/drivers/net/team/team.c index 5b169c18aaf6..c48ef19cac13 100644 --- a/trunk/drivers/net/team/team.c +++ b/trunk/drivers/net/team/team.c @@ -96,10 +96,13 @@ int team_options_register(struct team *team, size_t option_count) { int i; - struct team_option *dst_opts[option_count]; + struct team_option **dst_opts; int err; - memset(dst_opts, 0, sizeof(dst_opts)); + dst_opts = kzalloc(sizeof(struct team_option *) * option_count, + GFP_KERNEL); + if (!dst_opts) + return -ENOMEM; for (i = 0; i < option_count; i++, option++) { struct team_option *dst_opt; @@ -119,12 +122,14 @@ int team_options_register(struct team *team, for (i = 0; i < option_count; i++) list_add_tail(&dst_opts[i]->list, &team->option_list); + kfree(dst_opts); return 0; rollback: for (i = 0; i < option_count; i++) kfree(dst_opts[i]); + kfree(dst_opts); return err; }