diff options
| author | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-11-22 13:06:44 -0500 |
|---|---|---|
| committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-11-22 13:06:44 -0500 |
| commit | 0bd2af46839ad6262d25714a6ec0365db9d6b98f (patch) | |
| tree | dcced72d230d69fd0c5816ac6dd03ab84799a93e /crypto/api.c | |
| parent | e138a5d2356729b8752e88520cc1525fae9794ac (diff) | |
| parent | f26b90440cd74c78fe10c9bd5160809704a9627c (diff) | |
Merge ../scsi-rc-fixes-2.6
Diffstat (limited to 'crypto/api.c')
| -rw-r--r-- | crypto/api.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/crypto/api.c b/crypto/api.c index 2e84d4b54790..4fb7fa45cb0d 100644 --- a/crypto/api.c +++ b/crypto/api.c | |||
| @@ -331,7 +331,7 @@ struct crypto_tfm *__crypto_alloc_tfm(struct crypto_alg *alg, u32 flags) | |||
| 331 | tfm_size = sizeof(*tfm) + crypto_ctxsize(alg, flags); | 331 | tfm_size = sizeof(*tfm) + crypto_ctxsize(alg, flags); |
| 332 | tfm = kzalloc(tfm_size, GFP_KERNEL); | 332 | tfm = kzalloc(tfm_size, GFP_KERNEL); |
| 333 | if (tfm == NULL) | 333 | if (tfm == NULL) |
| 334 | goto out; | 334 | goto out_err; |
| 335 | 335 | ||
| 336 | tfm->__crt_alg = alg; | 336 | tfm->__crt_alg = alg; |
| 337 | 337 | ||
| @@ -355,6 +355,7 @@ cra_init_failed: | |||
| 355 | crypto_exit_ops(tfm); | 355 | crypto_exit_ops(tfm); |
| 356 | out_free_tfm: | 356 | out_free_tfm: |
| 357 | kfree(tfm); | 357 | kfree(tfm); |
| 358 | out_err: | ||
| 358 | tfm = ERR_PTR(err); | 359 | tfm = ERR_PTR(err); |
| 359 | out: | 360 | out: |
| 360 | return tfm; | 361 | return tfm; |
| @@ -414,14 +415,14 @@ struct crypto_tfm *crypto_alloc_base(const char *alg_name, u32 type, u32 mask) | |||
| 414 | struct crypto_alg *alg; | 415 | struct crypto_alg *alg; |
| 415 | 416 | ||
| 416 | alg = crypto_alg_mod_lookup(alg_name, type, mask); | 417 | alg = crypto_alg_mod_lookup(alg_name, type, mask); |
| 417 | err = PTR_ERR(alg); | 418 | if (IS_ERR(alg)) { |
| 418 | tfm = ERR_PTR(err); | 419 | err = PTR_ERR(alg); |
| 419 | if (IS_ERR(alg)) | ||
| 420 | goto err; | 420 | goto err; |
| 421 | } | ||
| 421 | 422 | ||
| 422 | tfm = __crypto_alloc_tfm(alg, 0); | 423 | tfm = __crypto_alloc_tfm(alg, 0); |
| 423 | if (!IS_ERR(tfm)) | 424 | if (!IS_ERR(tfm)) |
| 424 | break; | 425 | return tfm; |
| 425 | 426 | ||
| 426 | crypto_mod_put(alg); | 427 | crypto_mod_put(alg); |
| 427 | err = PTR_ERR(tfm); | 428 | err = PTR_ERR(tfm); |
| @@ -433,9 +434,9 @@ err: | |||
| 433 | err = -EINTR; | 434 | err = -EINTR; |
| 434 | break; | 435 | break; |
| 435 | } | 436 | } |
| 436 | }; | 437 | } |
| 437 | 438 | ||
| 438 | return tfm; | 439 | return ERR_PTR(err); |
| 439 | } | 440 | } |
| 440 | EXPORT_SYMBOL_GPL(crypto_alloc_base); | 441 | EXPORT_SYMBOL_GPL(crypto_alloc_base); |
| 441 | 442 | ||
