From: Pingchao Yang Date: Wed, 16 Dec 2015 06:09:50 +0000 (+0800) Subject: crypto: qat - fix some timeout tests X-Git-Tag: v4.5-rc1~129^2~35 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=51d77dddfff4a554744bfa0e67cf571319635645;p=karo-tx-linux.git crypto: qat - fix some timeout tests Change the timeout condition since the times value would be -1 after running MAX_RETRY_TIMES. Reported-by: Dan Carpenter Signed-off-by: Yang Pingchao Signed-off-by: Herbert Xu --- diff --git a/drivers/crypto/qat/qat_common/qat_hal.c b/drivers/crypto/qat/qat_common/qat_hal.c index 81bd1fed4eee..0ac0ba867611 100644 --- a/drivers/crypto/qat/qat_common/qat_hal.c +++ b/drivers/crypto/qat/qat_common/qat_hal.c @@ -186,7 +186,7 @@ static int qat_hal_wait_cycles(struct icp_qat_fw_loader_handle *handle, if (elapsed_cycles >= 8 && !(csr & (1 << ACS_ABO_BITPOS))) return 0; } - if (!times) { + if (times < 0) { pr_err("QAT: wait_num_cycles time out\n"); return -EFAULT; }