diff options
author | Arnaldo Carvalho de Melo <acme@mandriva.com> | 2006-11-17 08:14:16 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-12-03 00:23:55 -0500 |
commit | fac5d7315126f4b6745a8565c3a875617e02f8b8 (patch) | |
tree | b6a5fdcfe128193ad7b7d66059331df68ea0c418 /net/ipv4 | |
parent | f6685938f9181e95f814edfca287d4f04a925240 (diff) |
[NETLABEL]: Use kmemdup in cipso_ipv4.c
Code diff stats:
[acme@newtoy net-2.6.20]$ codiff /tmp/cipso_ipv4.o.before /tmp/cipso_ipv4.o.after
/pub/scm/linux/kernel/git/acme/net-2.6.20/net/ipv4/cipso_ipv4.c:
cipso_v4_cache_add | -46
1 function changed, 46 bytes removed
[acme@newtoy net-2.6.20]$
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/cipso_ipv4.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/net/ipv4/cipso_ipv4.c b/net/ipv4/cipso_ipv4.c index c3a61ebbadef..095038ad72a4 100644 --- a/net/ipv4/cipso_ipv4.c +++ b/net/ipv4/cipso_ipv4.c | |||
@@ -377,12 +377,11 @@ int cipso_v4_cache_add(const struct sk_buff *skb, | |||
377 | entry = kzalloc(sizeof(*entry), GFP_ATOMIC); | 377 | entry = kzalloc(sizeof(*entry), GFP_ATOMIC); |
378 | if (entry == NULL) | 378 | if (entry == NULL) |
379 | return -ENOMEM; | 379 | return -ENOMEM; |
380 | entry->key = kmalloc(cipso_ptr_len, GFP_ATOMIC); | 380 | entry->key = kmemdup(cipso_ptr, cipso_ptr_len, GFP_ATOMIC); |
381 | if (entry->key == NULL) { | 381 | if (entry->key == NULL) { |
382 | ret_val = -ENOMEM; | 382 | ret_val = -ENOMEM; |
383 | goto cache_add_failure; | 383 | goto cache_add_failure; |
384 | } | 384 | } |
385 | memcpy(entry->key, cipso_ptr, cipso_ptr_len); | ||
386 | entry->key_len = cipso_ptr_len; | 385 | entry->key_len = cipso_ptr_len; |
387 | entry->hash = cipso_v4_map_cache_hash(cipso_ptr, cipso_ptr_len); | 386 | entry->hash = cipso_v4_map_cache_hash(cipso_ptr, cipso_ptr_len); |
388 | atomic_inc(&secattr->cache->refcount); | 387 | atomic_inc(&secattr->cache->refcount); |