WIP: update tizen_qemu_defconfig
[platform/kernel/linux-starfive.git] / crypto / algapi.c
index 5c69ff8..8c3a869 100644 (file)
@@ -472,7 +472,9 @@ void crypto_unregister_alg(struct crypto_alg *alg)
        if (WARN(ret, "Algorithm %s is not registered", alg->cra_driver_name))
                return;
 
-       BUG_ON(refcount_read(&alg->cra_refcnt) != 1);
+       if (WARN_ON(refcount_read(&alg->cra_refcnt) != 1))
+               return;
+
        if (alg->cra_destroy)
                alg->cra_destroy(alg);
 
@@ -942,6 +944,9 @@ EXPORT_SYMBOL_GPL(crypto_enqueue_request);
 void crypto_enqueue_request_head(struct crypto_queue *queue,
                                 struct crypto_async_request *request)
 {
+       if (unlikely(queue->qlen >= queue->max_qlen))
+               queue->backlog = queue->backlog->prev;
+
        queue->qlen++;
        list_add(&request->list, &queue->list);
 }