From 0d32604cadc2b07039e3315a260214882b346727 Mon Sep 17 00:00:00 2001 From: tanshukun Date: Tue, 13 Aug 2019 18:45:07 +0800 Subject: [PATCH] crypto/hisilicon/qm: fix qm_log_hw_error() cycle bug driver inclusion category: bugfix bugzilla: NA CVE: NA Feature or Bugfix:Bugfix Signed-off-by: tanshukun (A) Reviewed-by: wangzhou Reviewed-by: Yang Yingliang Signed-off-by: Yang Yingliang --- drivers/crypto/hisilicon/qm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/hisilicon/qm.c b/drivers/crypto/hisilicon/qm.c index 502f25442023..395a46b34ba5 100644 --- a/drivers/crypto/hisilicon/qm.c +++ b/drivers/crypto/hisilicon/qm.c @@ -1071,11 +1071,13 @@ static void qm_hw_error_init_v2(struct hisi_qm *qm, u32 ce, u32 nfe, u32 fe, static void qm_log_hw_error(struct hisi_qm *qm, u32 error_status) { - const struct hisi_qm_hw_error *err = qm_hw_error; + const struct hisi_qm_hw_error *err; struct device *dev = &qm->pdev->dev; u32 reg_val, type, vf_num; + int i; - while ((err++)->msg) { + for (i = 0; i < ARRAY_SIZE(qm_hw_error); i++) { + err = &qm_hw_error[i]; if (!(err->int_msk & error_status)) continue; -- GitLab