summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2020-08-05 12:51:05 +0300
committerOded Gabbay <oded.gabbay@gmail.com>2020-08-22 12:47:57 +0300
commitb0353540ffd2d78dca232990719916bee58c7523 (patch)
tree3811a9007d710841d148163d577240b26e712d8c
parenteeec23cd325ad4d83927b8ee162693579cf3813f (diff)
downloadlinux-b0353540ffd2d78dca232990719916bee58c7523.tar.bz2
habanalabs: Fix a loop in gaudi_extract_ecc_info()
The condition was reversed. It should have been less than instead of greater than. The result is that we never enter the loop. Fixes: fcc6a4e60678 ("habanalabs: Extract ECC information from FW") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com> Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
-rw-r--r--drivers/misc/habanalabs/gaudi/gaudi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/misc/habanalabs/gaudi/gaudi.c b/drivers/misc/habanalabs/gaudi/gaudi.c
index 9ed4989b6fd4..08124873483f 100644
--- a/drivers/misc/habanalabs/gaudi/gaudi.c
+++ b/drivers/misc/habanalabs/gaudi/gaudi.c
@@ -5250,7 +5250,7 @@ static int gaudi_extract_ecc_info(struct hl_device *hdev,
*memory_wrapper_idx = 0xFF;
/* Iterate through memory wrappers, a single bit must be set */
- for (i = 0 ; i > num_mem_regs ; i++) {
+ for (i = 0 ; i < num_mem_regs ; i++) {
err_addr += i * 4;
err_word = RREG32(err_addr);
if (err_word) {