mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
team: replace kmalloc+memcpy by kmemdup
Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
2bba19fff8
commit
f8a15af093
1 changed files with 2 additions and 6 deletions
|
@ -104,19 +104,15 @@ int team_options_register(struct team *team,
|
|||
if (!dst_opts)
|
||||
return -ENOMEM;
|
||||
for (i = 0; i < option_count; i++, option++) {
|
||||
struct team_option *dst_opt;
|
||||
|
||||
if (__team_find_option(team, option->name)) {
|
||||
err = -EEXIST;
|
||||
goto rollback;
|
||||
}
|
||||
dst_opt = kmalloc(sizeof(*option), GFP_KERNEL);
|
||||
if (!dst_opt) {
|
||||
dst_opts[i] = kmemdup(option, sizeof(*option), GFP_KERNEL);
|
||||
if (!dst_opts[i]) {
|
||||
err = -ENOMEM;
|
||||
goto rollback;
|
||||
}
|
||||
memcpy(dst_opt, option, sizeof(*option));
|
||||
dst_opts[i] = dst_opt;
|
||||
}
|
||||
|
||||
for (i = 0; i < option_count; i++)
|
||||
|
|
Loading…
Reference in a new issue