Skip to content

Commit 0e7c353

Browse files
Colin Ian Kingmartinkpetersen
authored andcommitted
scsi: pm80xx: fix logic to break out of loop when register value is 2 or 3
The condition (reg_val != 2) || (reg_val != 3) will always be true because reg_val cannot be equal to two different values at the same time. Fix this by replacing the || operator with && so that the loop will loop if reg_val is not a 2 and not a 3 as was originally intended. Fixes: 50dc2f2 ("scsi: pm80xx: Modified the logic to collect fatal dump") Link: https://lore.kernel.org/r/[email protected] Addresses-Coverity: ("Constant expression result") Signed-off-by: Colin Ian King <[email protected]> Acked-by: Jack Wang <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 82ea3e0 commit 0e7c353

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/scsi/pm8001/pm80xx_hwi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ ssize_t pm80xx_get_fatal_dump(struct device *cdev,
348348
do {
349349
reg_val = pm8001_mr32(fatal_table_address,
350350
MPI_FATAL_EDUMP_TABLE_STATUS);
351-
} while (((reg_val != 2) || (reg_val != 3)) &&
351+
} while (((reg_val != 2) && (reg_val != 3)) &&
352352
time_before(jiffies, start));
353353

354354
if (reg_val < 2) {

0 commit comments

Comments
 (0)