: Use kmemdup where appropriate
Subsystems (2)
PATCH 5/11 : Use kmemdup where appropriate
Signed-off-by Arnaldo Carvalho de Melo <[email protected]>
--- net/ipv4/ipvs/ip_vs_app.c | 3 +-- net/ipv4/ipvs/ip_vs_proto.c | 8 +------- 2 files changed, 2 insertions(+), 9 deletions(-)
net/ipv4/ipvs/ip_vs_app.c +1 -2
@@ -80,10 +80,9 @@ ip_vs_app_inc_new(struct ip_vs_app *app,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;
net/ipv4/ipvs/ip_vs_proto.c +1 -7
@@ -118,13 +118,7 @@ void ip_vs_protocol_timeout_change(int fint *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 ); }
Signature · 1 line
1.4.2.1.g3d5c