Skip to content

Commit

Permalink
[IPVS]: Use kmemdup where appropriate
Browse files Browse the repository at this point in the history
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
  • Loading branch information
Arnaldo Carvalho de Melo authored and David S. Miller committed Dec 3, 2006
1 parent e6b6110 commit 8b2ed4b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
3 changes: 1 addition & 2 deletions net/ipv4/ipvs/ip_vs_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,9 @@ ip_vs_app_inc_new(struct ip_vs_app *app, __u16 proto, __u16 port)
if (!pp->unregister_app)
return -EOPNOTSUPP;

inc = kmalloc(sizeof(struct ip_vs_app), GFP_KERNEL);
inc = kmemdup(app, sizeof(*inc), GFP_KERNEL);
if (!inc)
return -ENOMEM;
memcpy(inc, app, sizeof(*inc));
INIT_LIST_HEAD(&inc->p_list);
INIT_LIST_HEAD(&inc->incs_list);
inc->app = app;
Expand Down
8 changes: 1 addition & 7 deletions net/ipv4/ipvs/ip_vs_proto.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,7 @@ void ip_vs_protocol_timeout_change(int flags)
int *
ip_vs_create_timeout_table(int *table, int size)
{
int *t;

t = kmalloc(size, GFP_ATOMIC);
if (t == NULL)
return NULL;
memcpy(t, table, size);
return t;
return kmemdup(table, size, GFP_ATOMIC);
}


Expand Down

0 comments on commit 8b2ed4b

Please sign in to comment.