Skip to content

Commit 5125e4e

Browse files
tititiou36herbertx
authored andcommitted
crypto: xts - Fix an error handling path in 'create()'
All error handling paths 'goto err_drop_spawn' except this one. In order to avoid some resources leak, we should do it as well here. Fixes: f1c131b ("crypto: xts - Convert to skcipher") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent 532f419 commit 5125e4e

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

crypto/xts.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -554,8 +554,10 @@ static int create(struct crypto_template *tmpl, struct rtattr **tb)
554554
ctx->name[len - 1] = 0;
555555

556556
if (snprintf(inst->alg.base.cra_name, CRYPTO_MAX_ALG_NAME,
557-
"xts(%s)", ctx->name) >= CRYPTO_MAX_ALG_NAME)
558-
return -ENAMETOOLONG;
557+
"xts(%s)", ctx->name) >= CRYPTO_MAX_ALG_NAME) {
558+
err = -ENAMETOOLONG;
559+
goto err_drop_spawn;
560+
}
559561
} else
560562
goto err_drop_spawn;
561563

0 commit comments

Comments
 (0)