Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 41866
b: refs/heads/master
c: cdbc6da
h: refs/heads/master
v: v3
  • Loading branch information
Arnaldo Carvalho de Melo authored and David S. Miller committed Dec 3, 2006
1 parent bf4e76b commit 5f70bb5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2710b57ff9b1437cfbe96b23ae86fedf3239f1ca
refs/heads/master: cdbc6dae5cc90d7d9e109e7d0568979d5355b653
9 changes: 3 additions & 6 deletions trunk/net/xfrm/xfrm_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,10 @@ static int attach_one_algo(struct xfrm_algo **algpp, u8 *props,
*props = algo->desc.sadb_alg_id;

len = sizeof(*ualg) + (ualg->alg_key_len + 7U) / 8;
p = kmalloc(len, GFP_KERNEL);
p = kmemdup(ualg, len, GFP_KERNEL);
if (!p)
return -ENOMEM;

memcpy(p, ualg, len);
strcpy(p->alg_name, algo->name);
*algpp = p;
return 0;
Expand All @@ -263,11 +262,10 @@ static int attach_encap_tmpl(struct xfrm_encap_tmpl **encapp, struct rtattr *u_a
return 0;

uencap = RTA_DATA(rta);
p = kmalloc(sizeof(*p), GFP_KERNEL);
p = kmemdup(uencap, sizeof(*p), GFP_KERNEL);
if (!p)
return -ENOMEM;

memcpy(p, uencap, sizeof(*p));
*encapp = p;
return 0;
}
Expand Down Expand Up @@ -305,11 +303,10 @@ static int attach_one_addr(xfrm_address_t **addrpp, struct rtattr *u_arg)
return 0;

uaddrp = RTA_DATA(rta);
p = kmalloc(sizeof(*p), GFP_KERNEL);
p = kmemdup(uaddrp, sizeof(*p), GFP_KERNEL);
if (!p)
return -ENOMEM;

memcpy(p, uaddrp, sizeof(*p));
*addrpp = p;
return 0;
}
Expand Down

0 comments on commit 5f70bb5

Please sign in to comment.