Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: 50dc2f221455 ("scsi: pm80xx: Modified the logic to collect fatal dump")
Link: https://lore.kernel.org/r/20191120135031.270708-1-colin.king@canonical.com
Addresses-Coverity: ("Constant expression result")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Jack Wang <jinpu.wang@cloud.ionos.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Colin Ian King and committed by
Martin K. Petersen
0e7c353e 82ea3e0e

+1 -1
+1 -1
drivers/scsi/pm8001/pm80xx_hwi.c
··· 348 348 do { 349 349 reg_val = pm8001_mr32(fatal_table_address, 350 350 MPI_FATAL_EDUMP_TABLE_STATUS); 351 - } while (((reg_val != 2) || (reg_val != 3)) && 351 + } while (((reg_val != 2) && (reg_val != 3)) && 352 352 time_before(jiffies, start)); 353 353 354 354 if (reg_val < 2) {