aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/tcrypt.c
diff options
context:
space:
mode:
authorRabin Vincent <rabin.vincent@axis.com>2015-01-09 10:25:28 -0500
committerHerbert Xu <herbert@gondor.apana.org.au>2015-01-13 06:30:44 -0500
commit8a45ac12ec5b6ee67f8559c78ae11d9af8b821ee (patch)
tree6e3930b39740e7070c50dc62101340a3e634175c /crypto/tcrypt.c
parent8155330aad477c5b1337895a6922df76817f0874 (diff)
crypto: testmgr - don't use interruptible wait in tests
tcrypt/testmgr uses wait_for_completion_interruptible() everywhere when it waits for a request to be completed. If it's interrupted, then the test is aborted and the request is freed. However, if any of these calls actually do get interrupted, the result will likely be a kernel crash, when the driver handles the now-freed request. Use wait_for_completion() instead. Signed-off-by: Rabin Vincent <rabin.vincent@axis.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/tcrypt.c')
-rw-r--r--crypto/tcrypt.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c
index 1d864e988ea9..004349576ba1 100644
--- a/crypto/tcrypt.c
+++ b/crypto/tcrypt.c
@@ -764,10 +764,9 @@ static inline int do_one_ahash_op(struct ahash_request *req, int ret)
764 if (ret == -EINPROGRESS || ret == -EBUSY) { 764 if (ret == -EINPROGRESS || ret == -EBUSY) {
765 struct tcrypt_result *tr = req->base.data; 765 struct tcrypt_result *tr = req->base.data;
766 766
767 ret = wait_for_completion_interruptible(&tr->completion); 767 wait_for_completion(&tr->completion);
768 if (!ret)
769 ret = tr->err;
770 reinit_completion(&tr->completion); 768 reinit_completion(&tr->completion);
769 ret = tr->err;
771 } 770 }
772 return ret; 771 return ret;
773} 772}
@@ -993,10 +992,9 @@ static inline int do_one_acipher_op(struct ablkcipher_request *req, int ret)
993 if (ret == -EINPROGRESS || ret == -EBUSY) { 992 if (ret == -EINPROGRESS || ret == -EBUSY) {
994 struct tcrypt_result *tr = req->base.data; 993 struct tcrypt_result *tr = req->base.data;
995 994
996 ret = wait_for_completion_interruptible(&tr->completion); 995 wait_for_completion(&tr->completion);
997 if (!ret)
998 ret = tr->err;
999 reinit_completion(&tr->completion); 996 reinit_completion(&tr->completion);
997 ret = tr->err;
1000 } 998 }
1001 999
1002 return ret; 1000 return ret;