diff options
Diffstat (limited to 'crypto/pcbc.c')
-rw-r--r-- | crypto/pcbc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/crypto/pcbc.c b/crypto/pcbc.c index ef802f6e9642..8aa10144407c 100644 --- a/crypto/pcbc.c +++ b/crypto/pcbc.c | |||
@@ -244,9 +244,8 @@ static int crypto_pcbc_create(struct crypto_template *tmpl, struct rtattr **tb) | |||
244 | spawn = skcipher_instance_ctx(inst); | 244 | spawn = skcipher_instance_ctx(inst); |
245 | err = crypto_init_spawn(spawn, alg, skcipher_crypto_instance(inst), | 245 | err = crypto_init_spawn(spawn, alg, skcipher_crypto_instance(inst), |
246 | CRYPTO_ALG_TYPE_MASK); | 246 | CRYPTO_ALG_TYPE_MASK); |
247 | crypto_mod_put(alg); | ||
248 | if (err) | 247 | if (err) |
249 | goto err_free_inst; | 248 | goto err_put_alg; |
250 | 249 | ||
251 | err = crypto_inst_setname(skcipher_crypto_instance(inst), "pcbc", alg); | 250 | err = crypto_inst_setname(skcipher_crypto_instance(inst), "pcbc", alg); |
252 | if (err) | 251 | if (err) |
@@ -275,12 +274,15 @@ static int crypto_pcbc_create(struct crypto_template *tmpl, struct rtattr **tb) | |||
275 | err = skcipher_register_instance(tmpl, inst); | 274 | err = skcipher_register_instance(tmpl, inst); |
276 | if (err) | 275 | if (err) |
277 | goto err_drop_spawn; | 276 | goto err_drop_spawn; |
277 | crypto_mod_put(alg); | ||
278 | 278 | ||
279 | out: | 279 | out: |
280 | return err; | 280 | return err; |
281 | 281 | ||
282 | err_drop_spawn: | 282 | err_drop_spawn: |
283 | crypto_drop_spawn(spawn); | 283 | crypto_drop_spawn(spawn); |
284 | err_put_alg: | ||
285 | crypto_mod_put(alg); | ||
284 | err_free_inst: | 286 | err_free_inst: |
285 | kfree(inst); | 287 | kfree(inst); |
286 | goto out; | 288 | goto out; |