projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fault-injection: notifier error injection
[firefly-linux-kernel-4.4.55.git]
/
crypto
/
algboss.c
diff --git
a/crypto/algboss.c
b/crypto/algboss.c
index 791d194958fa18ac0fb8006e5d565f789c1e4f92..769219b293098d43bd8406e296ff8b388869e8c1 100644
(file)
--- a/
crypto/algboss.c
+++ b/
crypto/algboss.c
@@
-11,6
+11,7
@@
*/
#include <crypto/internal/aead.h>
*/
#include <crypto/internal/aead.h>
+#include <linux/completion.h>
#include <linux/ctype.h>
#include <linux/err.h>
#include <linux/init.h>
#include <linux/ctype.h>
#include <linux/err.h>
#include <linux/init.h>
@@
-47,6
+48,8
@@
struct cryptomgr_param {
char larval[CRYPTO_MAX_ALG_NAME];
char template[CRYPTO_MAX_ALG_NAME];
char larval[CRYPTO_MAX_ALG_NAME];
char template[CRYPTO_MAX_ALG_NAME];
+ struct completion *completion;
+
u32 otype;
u32 omask;
};
u32 otype;
u32 omask;
};
@@
-66,7
+69,7
@@
static int cryptomgr_probe(void *data)
tmpl = crypto_lookup_template(param->template);
if (!tmpl)
tmpl = crypto_lookup_template(param->template);
if (!tmpl)
- goto
err
;
+ goto
out
;
do {
if (tmpl->create) {
do {
if (tmpl->create) {
@@
-83,16
+86,10
@@
static int cryptomgr_probe(void *data)
crypto_tmpl_put(tmpl);
crypto_tmpl_put(tmpl);
- if (err)
- goto err;
-
out:
out:
+ complete_all(param->completion);
kfree(param);
module_put_and_exit(0);
kfree(param);
module_put_and_exit(0);
-
-err:
- crypto_larval_error(param->larval, param->otype, param->omask);
- goto out;
}
static int cryptomgr_schedule_probe(struct crypto_larval *larval)
}
static int cryptomgr_schedule_probe(struct crypto_larval *larval)
@@
-192,10
+189,14
@@
static int cryptomgr_schedule_probe(struct crypto_larval *larval)
memcpy(param->larval, larval->alg.cra_name, CRYPTO_MAX_ALG_NAME);
memcpy(param->larval, larval->alg.cra_name, CRYPTO_MAX_ALG_NAME);
+ param->completion = &larval->completion;
+
thread = kthread_run(cryptomgr_probe, param, "cryptomgr_probe");
if (IS_ERR(thread))
goto err_free_param;
thread = kthread_run(cryptomgr_probe, param, "cryptomgr_probe");
if (IS_ERR(thread))
goto err_free_param;
+ wait_for_completion_interruptible(&larval->completion);
+
return NOTIFY_STOP;
err_free_param:
return NOTIFY_STOP;
err_free_param: