aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2007-12-31 23:44:50 -0500
committerHerbert Xu <herbert@gondor.apana.org.au>2008-01-10 16:17:00 -0500
commit1b87887d6c232becba77835b29a424cf78442b7d (patch)
tree0580c28ba6f4bc08caa847d26d9ac3f87046f4eb
parent2a999a3abb2d3885741b09b9d05280db7e757544 (diff)
[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>
-rw-r--r--crypto/xcbc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/xcbc.c b/crypto/xcbc.c
index 789cdeee6b7d..e3d9503a034b 100644
--- a/crypto/xcbc.c
+++ b/crypto/xcbc.c
@@ -307,7 +307,8 @@ static struct crypto_instance *xcbc_alloc(struct rtattr **tb)
307 case 16: 307 case 16:
308 break; 308 break;
309 default: 309 default:
310 return ERR_PTR(PTR_ERR(alg)); 310 inst = ERR_PTR(-EINVAL);
311 goto out_put_alg;
311 } 312 }
312 313
313 inst = crypto_alloc_instance("xcbc", alg); 314 inst = crypto_alloc_instance("xcbc", alg);