1
0
Fork 0

[CRYPTO] xcbc: Fix algorithm leak when block size check fails

When the underlying algorithm has a block size other than 16 we abort
without freeing it.  In fact, we try to return the algorithm itself
as an error!

This patch plugs the leak and makes it return -EINVAL instead.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
wifi-calibration
Herbert Xu 2008-01-01 15:44:50 +11:00
parent 2a999a3abb
commit 1b87887d6c
1 changed files with 2 additions and 1 deletions

View File

@ -307,7 +307,8 @@ static struct crypto_instance *xcbc_alloc(struct rtattr **tb)
case 16:
break;
default:
return ERR_PTR(PTR_ERR(alg));
inst = ERR_PTR(-EINVAL);
goto out_put_alg;
}
inst = crypto_alloc_instance("xcbc", alg);