From 9a42e4eed3fcd7ba8dff6622384cd08bfe5ef707 Mon Sep 17 00:00:00 2001 From: Zain Wang Date: Mon, 24 Jul 2017 09:23:14 +0800 Subject: crypto: rockchip - return the err code when unable dequeue the crypto request Sometime we would unable to dequeue the crypto request, in this case, we should finish crypto and return the err code. Signed-off-by: zain wang Signed-off-by: Herbert Xu --- drivers/crypto/rockchip/rk3288_crypto.c | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'drivers/crypto/rockchip/rk3288_crypto.c') diff --git a/drivers/crypto/rockchip/rk3288_crypto.c b/drivers/crypto/rockchip/rk3288_crypto.c index c2b1dd70f9f7..57c37831bd42 100644 --- a/drivers/crypto/rockchip/rk3288_crypto.c +++ b/drivers/crypto/rockchip/rk3288_crypto.c @@ -187,27 +187,8 @@ static irqreturn_t rk_crypto_irq_handle(int irq, void *dev_id) static void rk_crypto_queue_task_cb(unsigned long data) { struct rk_crypto_info *dev = (struct rk_crypto_info *)data; - struct crypto_async_request *async_req, *backlog; - unsigned long flags; int err = 0; - spin_lock_irqsave(&dev->lock, flags); - backlog = crypto_get_backlog(&dev->queue); - async_req = crypto_dequeue_request(&dev->queue); - spin_unlock_irqrestore(&dev->lock, flags); - if (!async_req) { - dev_err(dev->dev, "async_req is NULL !!\n"); - return; - } - if (backlog) { - backlog->complete(backlog, -EINPROGRESS); - backlog = NULL; - } - - if (crypto_tfm_alg_type(async_req->tfm) == CRYPTO_ALG_TYPE_ABLKCIPHER) - dev->ablk_req = ablkcipher_request_cast(async_req); - else - dev->ahash_req = ahash_request_cast(async_req); dev->err = 0; err = dev->start(dev); if (err) -- cgit v1.2.3