aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/devinet.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@mandriva.com>2006-11-17 08:18:20 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2006-12-03 00:23:56 -0500
commit42e5ea466c1897c4ac2e3b4fe0b33a28e9e3d5de (patch)
tree3184524900251020a19f338295473616e884be97 /net/ipv4/devinet.c
parentfac5d7315126f4b6745a8565c3a875617e02f8b8 (diff)
[IPV4]: Use kmemdup in net/ipv4/devinet.c
Code diff stats: [acme@newtoy net-2.6.20]$ codiff /tmp/devinet.o.before /tmp/devinet.o.after /pub/scm/linux/kernel/git/acme/net-2.6.20/net/ipv4/devinet.c: devinet_sysctl_register | -38 1 function changed, 38 bytes removed [acme@newtoy net-2.6.20]$ Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Diffstat (limited to 'net/ipv4/devinet.c')
-rw-r--r--net/ipv4/devinet.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index a1b356c8aa59..2fd899160f85 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -1564,12 +1564,12 @@ static void devinet_sysctl_register(struct in_device *in_dev,
1564{ 1564{
1565 int i; 1565 int i;
1566 struct net_device *dev = in_dev ? in_dev->dev : NULL; 1566 struct net_device *dev = in_dev ? in_dev->dev : NULL;
1567 struct devinet_sysctl_table *t = kmalloc(sizeof(*t), GFP_KERNEL); 1567 struct devinet_sysctl_table *t = kmemdup(&devinet_sysctl, sizeof(*t),
1568 GFP_KERNEL);
1568 char *dev_name = NULL; 1569 char *dev_name = NULL;
1569 1570
1570 if (!t) 1571 if (!t)
1571 return; 1572 return;
1572 memcpy(t, &devinet_sysctl, sizeof(*t));
1573 for (i = 0; i < ARRAY_SIZE(t->devinet_vars) - 1; i++) { 1573 for (i = 0; i < ARRAY_SIZE(t->devinet_vars) - 1; i++) {
1574 t->devinet_vars[i].data += (char *)p - (char *)&ipv4_devconf; 1574 t->devinet_vars[i].data += (char *)p - (char *)&ipv4_devconf;
1575 t->devinet_vars[i].de = NULL; 1575 t->devinet_vars[i].de = NULL;