diff options
author | Shan Wei <shanwei@cn.fujitsu.com> | 2011-03-07 05:11:34 +0300 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2011-03-15 03:36:49 +0300 |
commit | 6060c74a3de8ed142c78133e2829e74711f77387 (patch) | |
tree | f8c9ee782481774229e3e92df3b77021238e65c2 /net/netfilter/ipvs/ip_vs_pe_sip.c | |
parent | 4a569c0c0f833adace1e3aadaa38780ec2fcdf9e (diff) | |
download | linux-6060c74a3de8ed142c78133e2829e74711f77387.tar.xz |
netfilter:ipvs: use kmemdup
The semantic patch that makes this output is available
in scripts/coccinelle/api/memdup.cocci.
More information about semantic patching is available at
http://coccinelle.lip6.fr/
Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'net/netfilter/ipvs/ip_vs_pe_sip.c')
-rw-r--r-- | net/netfilter/ipvs/ip_vs_pe_sip.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/net/netfilter/ipvs/ip_vs_pe_sip.c b/net/netfilter/ipvs/ip_vs_pe_sip.c index 0d83bc01fed4..13d607ae9c52 100644 --- a/net/netfilter/ipvs/ip_vs_pe_sip.c +++ b/net/netfilter/ipvs/ip_vs_pe_sip.c @@ -92,14 +92,13 @@ ip_vs_sip_fill_param(struct ip_vs_conn_param *p, struct sk_buff *skb) if (get_callid(dptr, dataoff, datalen, &matchoff, &matchlen)) return -EINVAL; - p->pe_data = kmalloc(matchlen, GFP_ATOMIC); - if (!p->pe_data) - return -ENOMEM; - /* N.B: pe_data is only set on success, * this allows fallback to the default persistence logic on failure */ - memcpy(p->pe_data, dptr + matchoff, matchlen); + p->pe_data = kmemdup(dptr + matchoff, matchlen, GFP_ATOMIC); + if (!p->pe_data) + return -ENOMEM; + p->pe_data_len = matchlen; return 0; |