Skip to content

Commit

Permalink
[IPV4]: Use kmemdup in net/ipv4/devinet.c
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Arnaldo Carvalho de Melo authored and David S. Miller committed Dec 3, 2006
1 parent fac5d73 commit 42e5ea4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/ipv4/devinet.c
Original file line number Diff line number Diff line change
Expand Up @@ -1564,12 +1564,12 @@ static void devinet_sysctl_register(struct in_device *in_dev,
{
int i;
struct net_device *dev = in_dev ? in_dev->dev : NULL;
struct devinet_sysctl_table *t = kmalloc(sizeof(*t), GFP_KERNEL);
struct devinet_sysctl_table *t = kmemdup(&devinet_sysctl, sizeof(*t),
GFP_KERNEL);
char *dev_name = NULL;

if (!t)
return;
memcpy(t, &devinet_sysctl, sizeof(*t));
for (i = 0; i < ARRAY_SIZE(t->devinet_vars) - 1; i++) {
t->devinet_vars[i].data += (char *)p - (char *)&ipv4_devconf;
t->devinet_vars[i].de = NULL;
Expand Down

0 comments on commit 42e5ea4

Please sign in to comment.