aboutsummaryrefslogtreecommitdiffstats
path: root/net/xfrm
diff options
context:
space:
mode:
Diffstat (limited to 'net/xfrm')
-rw-r--r--net/xfrm/xfrm_state.c12
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)
1106 int err = -ENOMEM; 1106 int err = -ENOMEM;
1107 struct xfrm_state *x = xfrm_state_alloc(net); 1107 struct xfrm_state *x = xfrm_state_alloc(net);
1108 if (!x) 1108 if (!x)
1109 goto error; 1109 goto out;
1110 1110
1111 memcpy(&x->id, &orig->id, sizeof(x->id)); 1111 memcpy(&x->id, &orig->id, sizeof(x->id));
1112 memcpy(&x->sel, &orig->sel, sizeof(x->sel)); 1112 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)
1164 return x; 1164 return x;
1165 1165
1166 error: 1166 error:
1167 xfrm_state_put(x);
1168out:
1167 if (errp) 1169 if (errp)
1168 *errp = err; 1170 *errp = err;
1169 if (x) {
1170 kfree(x->aalg);
1171 kfree(x->ealg);
1172 kfree(x->calg);
1173 kfree(x->encap);
1174 kfree(x->coaddr);
1175 }
1176 kfree(x);
1177 return NULL; 1171 return NULL;
1178} 1172}
1179 1173