diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/ah4.c | 18 | ||||
-rw-r--r-- | net/ipv4/esp4.c | 24 | ||||
-rw-r--r-- | net/ipv4/ipcomp.c | 3 | ||||
-rw-r--r-- | net/ipv6/addrconf.c | 6 | ||||
-rw-r--r-- | net/ipv6/ah6.c | 18 | ||||
-rw-r--r-- | net/ipv6/esp6.c | 24 | ||||
-rw-r--r-- | net/ipv6/ipcomp6.c | 3 | ||||
-rw-r--r-- | net/sctp/endpointola.c | 3 | ||||
-rw-r--r-- | net/sctp/socket.c | 3 | ||||
-rw-r--r-- | net/sunrpc/auth_gss/gss_krb5_crypto.c | 3 | ||||
-rw-r--r-- | net/sunrpc/auth_gss/gss_krb5_mech.c | 9 | ||||
-rw-r--r-- | net/sunrpc/auth_gss/gss_spkm3_mech.c | 12 |
12 files changed, 42 insertions, 84 deletions
diff --git a/net/ipv4/ah4.c b/net/ipv4/ah4.c index 514c85b2631a..035ad2c9e1ba 100644 --- a/net/ipv4/ah4.c +++ b/net/ipv4/ah4.c | |||
@@ -263,10 +263,8 @@ static int ah_init_state(struct xfrm_state *x) | |||
263 | 263 | ||
264 | error: | 264 | error: |
265 | if (ahp) { | 265 | if (ahp) { |
266 | if (ahp->work_icv) | 266 | kfree(ahp->work_icv); |
267 | kfree(ahp->work_icv); | 267 | crypto_free_tfm(ahp->tfm); |
268 | if (ahp->tfm) | ||
269 | crypto_free_tfm(ahp->tfm); | ||
270 | kfree(ahp); | 268 | kfree(ahp); |
271 | } | 269 | } |
272 | return -EINVAL; | 270 | return -EINVAL; |
@@ -279,14 +277,10 @@ static void ah_destroy(struct xfrm_state *x) | |||
279 | if (!ahp) | 277 | if (!ahp) |
280 | return; | 278 | return; |
281 | 279 | ||
282 | if (ahp->work_icv) { | 280 | kfree(ahp->work_icv); |
283 | kfree(ahp->work_icv); | 281 | ahp->work_icv = NULL; |
284 | ahp->work_icv = NULL; | 282 | crypto_free_tfm(ahp->tfm); |
285 | } | 283 | ahp->tfm = NULL; |
286 | if (ahp->tfm) { | ||
287 | crypto_free_tfm(ahp->tfm); | ||
288 | ahp->tfm = NULL; | ||
289 | } | ||
290 | kfree(ahp); | 284 | kfree(ahp); |
291 | } | 285 | } |
292 | 286 | ||
diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c index b31ffc5053d2..1b5a09d1b90b 100644 --- a/net/ipv4/esp4.c +++ b/net/ipv4/esp4.c | |||
@@ -343,22 +343,14 @@ static void esp_destroy(struct xfrm_state *x) | |||
343 | if (!esp) | 343 | if (!esp) |
344 | return; | 344 | return; |
345 | 345 | ||
346 | if (esp->conf.tfm) { | 346 | crypto_free_tfm(esp->conf.tfm); |
347 | crypto_free_tfm(esp->conf.tfm); | 347 | esp->conf.tfm = NULL; |
348 | esp->conf.tfm = NULL; | 348 | kfree(esp->conf.ivec); |
349 | } | 349 | esp->conf.ivec = NULL; |
350 | if (esp->conf.ivec) { | 350 | crypto_free_tfm(esp->auth.tfm); |
351 | kfree(esp->conf.ivec); | 351 | esp->auth.tfm = NULL; |
352 | esp->conf.ivec = NULL; | 352 | kfree(esp->auth.work_icv); |
353 | } | 353 | esp->auth.work_icv = NULL; |
354 | if (esp->auth.tfm) { | ||
355 | crypto_free_tfm(esp->auth.tfm); | ||
356 | esp->auth.tfm = NULL; | ||
357 | } | ||
358 | if (esp->auth.work_icv) { | ||
359 | kfree(esp->auth.work_icv); | ||
360 | esp->auth.work_icv = NULL; | ||
361 | } | ||
362 | kfree(esp); | 354 | kfree(esp); |
363 | } | 355 | } |
364 | 356 | ||
diff --git a/net/ipv4/ipcomp.c b/net/ipv4/ipcomp.c index dcb7ee6c4858..fc718df17b40 100644 --- a/net/ipv4/ipcomp.c +++ b/net/ipv4/ipcomp.c | |||
@@ -345,8 +345,7 @@ static void ipcomp_free_tfms(struct crypto_tfm **tfms) | |||
345 | 345 | ||
346 | for_each_cpu(cpu) { | 346 | for_each_cpu(cpu) { |
347 | struct crypto_tfm *tfm = *per_cpu_ptr(tfms, cpu); | 347 | struct crypto_tfm *tfm = *per_cpu_ptr(tfms, cpu); |
348 | if (tfm) | 348 | crypto_free_tfm(tfm); |
349 | crypto_free_tfm(tfm); | ||
350 | } | 349 | } |
351 | free_percpu(tfms); | 350 | free_percpu(tfms); |
352 | } | 351 | } |
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 937ad32db77c..6d6fb74f3b52 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -3593,10 +3593,8 @@ void __exit addrconf_cleanup(void) | |||
3593 | rtnl_unlock(); | 3593 | rtnl_unlock(); |
3594 | 3594 | ||
3595 | #ifdef CONFIG_IPV6_PRIVACY | 3595 | #ifdef CONFIG_IPV6_PRIVACY |
3596 | if (likely(md5_tfm != NULL)) { | 3596 | crypto_free_tfm(md5_tfm); |
3597 | crypto_free_tfm(md5_tfm); | 3597 | md5_tfm = NULL; |
3598 | md5_tfm = NULL; | ||
3599 | } | ||
3600 | #endif | 3598 | #endif |
3601 | 3599 | ||
3602 | #ifdef CONFIG_PROC_FS | 3600 | #ifdef CONFIG_PROC_FS |
diff --git a/net/ipv6/ah6.c b/net/ipv6/ah6.c index 0ebfad907a03..f3629730eb15 100644 --- a/net/ipv6/ah6.c +++ b/net/ipv6/ah6.c | |||
@@ -401,10 +401,8 @@ static int ah6_init_state(struct xfrm_state *x) | |||
401 | 401 | ||
402 | error: | 402 | error: |
403 | if (ahp) { | 403 | if (ahp) { |
404 | if (ahp->work_icv) | 404 | kfree(ahp->work_icv); |
405 | kfree(ahp->work_icv); | 405 | crypto_free_tfm(ahp->tfm); |
406 | if (ahp->tfm) | ||
407 | crypto_free_tfm(ahp->tfm); | ||
408 | kfree(ahp); | 406 | kfree(ahp); |
409 | } | 407 | } |
410 | return -EINVAL; | 408 | return -EINVAL; |
@@ -417,14 +415,10 @@ static void ah6_destroy(struct xfrm_state *x) | |||
417 | if (!ahp) | 415 | if (!ahp) |
418 | return; | 416 | return; |
419 | 417 | ||
420 | if (ahp->work_icv) { | 418 | kfree(ahp->work_icv); |
421 | kfree(ahp->work_icv); | 419 | ahp->work_icv = NULL; |
422 | ahp->work_icv = NULL; | 420 | crypto_free_tfm(ahp->tfm); |
423 | } | 421 | ahp->tfm = NULL; |
424 | if (ahp->tfm) { | ||
425 | crypto_free_tfm(ahp->tfm); | ||
426 | ahp->tfm = NULL; | ||
427 | } | ||
428 | kfree(ahp); | 422 | kfree(ahp); |
429 | } | 423 | } |
430 | 424 | ||
diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c index e8bff9d3d96c..9b27460f0cc7 100644 --- a/net/ipv6/esp6.c +++ b/net/ipv6/esp6.c | |||
@@ -276,22 +276,14 @@ static void esp6_destroy(struct xfrm_state *x) | |||
276 | if (!esp) | 276 | if (!esp) |
277 | return; | 277 | return; |
278 | 278 | ||
279 | if (esp->conf.tfm) { | 279 | crypto_free_tfm(esp->conf.tfm); |
280 | crypto_free_tfm(esp->conf.tfm); | 280 | esp->conf.tfm = NULL; |
281 | esp->conf.tfm = NULL; | 281 | kfree(esp->conf.ivec); |
282 | } | 282 | esp->conf.ivec = NULL; |
283 | if (esp->conf.ivec) { | 283 | crypto_free_tfm(esp->auth.tfm); |
284 | kfree(esp->conf.ivec); | 284 | esp->auth.tfm = NULL; |
285 | esp->conf.ivec = NULL; | 285 | kfree(esp->auth.work_icv); |
286 | } | 286 | esp->auth.work_icv = NULL; |
287 | if (esp->auth.tfm) { | ||
288 | crypto_free_tfm(esp->auth.tfm); | ||
289 | esp->auth.tfm = NULL; | ||
290 | } | ||
291 | if (esp->auth.work_icv) { | ||
292 | kfree(esp->auth.work_icv); | ||
293 | esp->auth.work_icv = NULL; | ||
294 | } | ||
295 | kfree(esp); | 287 | kfree(esp); |
296 | } | 288 | } |
297 | 289 | ||
diff --git a/net/ipv6/ipcomp6.c b/net/ipv6/ipcomp6.c index 135383ef538f..85bfbc69b2c3 100644 --- a/net/ipv6/ipcomp6.c +++ b/net/ipv6/ipcomp6.c | |||
@@ -341,8 +341,7 @@ static void ipcomp6_free_tfms(struct crypto_tfm **tfms) | |||
341 | 341 | ||
342 | for_each_cpu(cpu) { | 342 | for_each_cpu(cpu) { |
343 | struct crypto_tfm *tfm = *per_cpu_ptr(tfms, cpu); | 343 | struct crypto_tfm *tfm = *per_cpu_ptr(tfms, cpu); |
344 | if (tfm) | 344 | crypto_free_tfm(tfm); |
345 | crypto_free_tfm(tfm); | ||
346 | } | 345 | } |
347 | free_percpu(tfms); | 346 | free_percpu(tfms); |
348 | } | 347 | } |
diff --git a/net/sctp/endpointola.c b/net/sctp/endpointola.c index e47ac0d1a6d6..e22ccd655965 100644 --- a/net/sctp/endpointola.c +++ b/net/sctp/endpointola.c | |||
@@ -193,8 +193,7 @@ static void sctp_endpoint_destroy(struct sctp_endpoint *ep) | |||
193 | sctp_unhash_endpoint(ep); | 193 | sctp_unhash_endpoint(ep); |
194 | 194 | ||
195 | /* Free up the HMAC transform. */ | 195 | /* Free up the HMAC transform. */ |
196 | if (sctp_sk(ep->base.sk)->hmac) | 196 | sctp_crypto_free_tfm(sctp_sk(ep->base.sk)->hmac); |
197 | sctp_crypto_free_tfm(sctp_sk(ep->base.sk)->hmac); | ||
198 | 197 | ||
199 | /* Cleanup. */ | 198 | /* Cleanup. */ |
200 | sctp_inq_free(&ep->base.inqueue); | 199 | sctp_inq_free(&ep->base.inqueue); |
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index 4454afe4727e..91ec8c936913 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c | |||
@@ -4194,8 +4194,7 @@ out: | |||
4194 | sctp_release_sock(sk); | 4194 | sctp_release_sock(sk); |
4195 | return err; | 4195 | return err; |
4196 | cleanup: | 4196 | cleanup: |
4197 | if (tfm) | 4197 | sctp_crypto_free_tfm(tfm); |
4198 | sctp_crypto_free_tfm(tfm); | ||
4199 | goto out; | 4198 | goto out; |
4200 | } | 4199 | } |
4201 | 4200 | ||
diff --git a/net/sunrpc/auth_gss/gss_krb5_crypto.c b/net/sunrpc/auth_gss/gss_krb5_crypto.c index 7ad74449b18f..ee6ae74cd1b2 100644 --- a/net/sunrpc/auth_gss/gss_krb5_crypto.c +++ b/net/sunrpc/auth_gss/gss_krb5_crypto.c | |||
@@ -199,8 +199,7 @@ make_checksum(s32 cksumtype, char *header, int hdrlen, struct xdr_buf *body, | |||
199 | crypto_digest_final(tfm, cksum->data); | 199 | crypto_digest_final(tfm, cksum->data); |
200 | code = 0; | 200 | code = 0; |
201 | out: | 201 | out: |
202 | if (tfm) | 202 | crypto_free_tfm(tfm); |
203 | crypto_free_tfm(tfm); | ||
204 | return code; | 203 | return code; |
205 | } | 204 | } |
206 | 205 | ||
diff --git a/net/sunrpc/auth_gss/gss_krb5_mech.c b/net/sunrpc/auth_gss/gss_krb5_mech.c index cf726510df8e..606a8a82cafb 100644 --- a/net/sunrpc/auth_gss/gss_krb5_mech.c +++ b/net/sunrpc/auth_gss/gss_krb5_mech.c | |||
@@ -185,12 +185,9 @@ static void | |||
185 | gss_delete_sec_context_kerberos(void *internal_ctx) { | 185 | gss_delete_sec_context_kerberos(void *internal_ctx) { |
186 | struct krb5_ctx *kctx = internal_ctx; | 186 | struct krb5_ctx *kctx = internal_ctx; |
187 | 187 | ||
188 | if (kctx->seq) | 188 | crypto_free_tfm(kctx->seq); |
189 | crypto_free_tfm(kctx->seq); | 189 | crypto_free_tfm(kctx->enc); |
190 | if (kctx->enc) | 190 | kfree(kctx->mech_used.data); |
191 | crypto_free_tfm(kctx->enc); | ||
192 | if (kctx->mech_used.data) | ||
193 | kfree(kctx->mech_used.data); | ||
194 | kfree(kctx); | 191 | kfree(kctx); |
195 | } | 192 | } |
196 | 193 | ||
diff --git a/net/sunrpc/auth_gss/gss_spkm3_mech.c b/net/sunrpc/auth_gss/gss_spkm3_mech.c index dad05994c3eb..6c97d61baa9b 100644 --- a/net/sunrpc/auth_gss/gss_spkm3_mech.c +++ b/net/sunrpc/auth_gss/gss_spkm3_mech.c | |||
@@ -214,14 +214,10 @@ static void | |||
214 | gss_delete_sec_context_spkm3(void *internal_ctx) { | 214 | gss_delete_sec_context_spkm3(void *internal_ctx) { |
215 | struct spkm3_ctx *sctx = internal_ctx; | 215 | struct spkm3_ctx *sctx = internal_ctx; |
216 | 216 | ||
217 | if(sctx->derived_integ_key) | 217 | crypto_free_tfm(sctx->derived_integ_key); |
218 | crypto_free_tfm(sctx->derived_integ_key); | 218 | crypto_free_tfm(sctx->derived_conf_key); |
219 | if(sctx->derived_conf_key) | 219 | kfree(sctx->share_key.data); |
220 | crypto_free_tfm(sctx->derived_conf_key); | 220 | kfree(sctx->mech_used.data); |
221 | if(sctx->share_key.data) | ||
222 | kfree(sctx->share_key.data); | ||
223 | if(sctx->mech_used.data) | ||
224 | kfree(sctx->mech_used.data); | ||
225 | kfree(sctx); | 221 | kfree(sctx); |
226 | } | 222 | } |
227 | 223 | ||