diff options
author | David S. Miller <davem@davemloft.net> | 2010-02-17 07:09:29 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-17 07:09:29 +0100 |
commit | 2bb4646fce8d09916b351d1a62f98db7cec6fc41 (patch) | |
tree | c1f0d002e69868606eca9d1b919835f422892063 /net/xfrm | |
parent | xfrm: avoid spinlock in get_acqseq() used by xfrm user (diff) | |
parent | Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6 (diff) | |
download | linux-2bb4646fce8d09916b351d1a62f98db7cec6fc41.tar.xz linux-2bb4646fce8d09916b351d1a62f98db7cec6fc41.zip |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Diffstat (limited to 'net/xfrm')
-rw-r--r-- | net/xfrm/xfrm_state.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index 96f2088e7448..9fa3322b2a7d 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c @@ -1106,7 +1106,7 @@ static struct xfrm_state *xfrm_state_clone(struct xfrm_state *orig, int *errp) int err = -ENOMEM; struct xfrm_state *x = xfrm_state_alloc(net); if (!x) - goto error; + goto out; memcpy(&x->id, &orig->id, sizeof(x->id)); memcpy(&x->sel, &orig->sel, sizeof(x->sel)); @@ -1164,16 +1164,10 @@ static struct xfrm_state *xfrm_state_clone(struct xfrm_state *orig, int *errp) return x; error: + xfrm_state_put(x); +out: if (errp) *errp = err; - if (x) { - kfree(x->aalg); - kfree(x->ealg); - kfree(x->calg); - kfree(x->encap); - kfree(x->coaddr); - } - kfree(x); return NULL; } |