diff options
Diffstat (limited to 'net/xfrm/xfrm_state.c')
-rw-r--r-- | net/xfrm/xfrm_state.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index ee62c239a7e3..17b29ec3c417 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c | |||
@@ -77,6 +77,8 @@ static void xfrm_state_gc_destroy(struct xfrm_state *x) | |||
77 | kfree(x->ealg); | 77 | kfree(x->ealg); |
78 | kfree(x->calg); | 78 | kfree(x->calg); |
79 | kfree(x->encap); | 79 | kfree(x->encap); |
80 | if (x->mode) | ||
81 | xfrm_put_mode(x->mode); | ||
80 | if (x->type) { | 82 | if (x->type) { |
81 | x->type->destructor(x); | 83 | x->type->destructor(x); |
82 | xfrm_put_type(x->type); | 84 | xfrm_put_type(x->type); |
@@ -1193,6 +1195,10 @@ int xfrm_init_state(struct xfrm_state *x) | |||
1193 | if (err) | 1195 | if (err) |
1194 | goto error; | 1196 | goto error; |
1195 | 1197 | ||
1198 | x->mode = xfrm_get_mode(x->props.mode, family); | ||
1199 | if (x->mode == NULL) | ||
1200 | goto error; | ||
1201 | |||
1196 | x->km.state = XFRM_STATE_VALID; | 1202 | x->km.state = XFRM_STATE_VALID; |
1197 | 1203 | ||
1198 | error: | 1204 | error: |