summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crypto/algapi.c6
-rw-r--r--crypto/cryptd.c4
2 files changed, 5 insertions, 5 deletions
diff --git a/crypto/algapi.c b/crypto/algapi.c
index aa699ff6c876..60d7366ed343 100644
--- a/crypto/algapi.c
+++ b/crypto/algapi.c
@@ -897,9 +897,11 @@ int crypto_enqueue_request(struct crypto_queue *queue,
897 int err = -EINPROGRESS; 897 int err = -EINPROGRESS;
898 898
899 if (unlikely(queue->qlen >= queue->max_qlen)) { 899 if (unlikely(queue->qlen >= queue->max_qlen)) {
900 err = -EBUSY; 900 if (!(request->flags & CRYPTO_TFM_REQ_MAY_BACKLOG)) {
901 if (!(request->flags & CRYPTO_TFM_REQ_MAY_BACKLOG)) 901 err = -ENOSPC;
902 goto out; 902 goto out;
903 }
904 err = -EBUSY;
903 if (queue->backlog == &queue->list) 905 if (queue->backlog == &queue->list)
904 queue->backlog = &request->list; 906 queue->backlog = &request->list;
905 } 907 }
diff --git a/crypto/cryptd.c b/crypto/cryptd.c
index 0508c48a45c4..bd43cf5be14c 100644
--- a/crypto/cryptd.c
+++ b/crypto/cryptd.c
@@ -137,16 +137,14 @@ static int cryptd_enqueue_request(struct cryptd_queue *queue,
137 int cpu, err; 137 int cpu, err;
138 struct cryptd_cpu_queue *cpu_queue; 138 struct cryptd_cpu_queue *cpu_queue;
139 atomic_t *refcnt; 139 atomic_t *refcnt;
140 bool may_backlog;
141 140
142 cpu = get_cpu(); 141 cpu = get_cpu();
143 cpu_queue = this_cpu_ptr(queue->cpu_queue); 142 cpu_queue = this_cpu_ptr(queue->cpu_queue);
144 err = crypto_enqueue_request(&cpu_queue->queue, request); 143 err = crypto_enqueue_request(&cpu_queue->queue, request);
145 144
146 refcnt = crypto_tfm_ctx(request->tfm); 145 refcnt = crypto_tfm_ctx(request->tfm);
147 may_backlog = request->flags & CRYPTO_TFM_REQ_MAY_BACKLOG;
148 146
149 if (err == -EBUSY && !may_backlog) 147 if (err == -ENOSPC)
150 goto out_put_cpu; 148 goto out_put_cpu;
151 149
152 queue_work_on(cpu, kcrypto_wq, &cpu_queue->work); 150 queue_work_on(cpu, kcrypto_wq, &cpu_queue->work);