OSDN Git Service

scsi: isci: Fix infinite loop in while loop
authorColin Ian King <colin.king@canonical.com>
Fri, 20 Apr 2018 09:57:16 +0000 (10:57 +0100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 20 Apr 2018 23:23:32 +0000 (19:23 -0400)
commit4bc83b3f272fe8f36450f9c003df49cf07ffe5fd
treef72e55b77d02470d1dfdcadca9a713a8c985ba32
parentf286299c1d0ba5e2ca0377610307b370fe178767
scsi: isci: Fix infinite loop in while loop

In the case when the phy_mask is bitwise anded with the phy_index bit is
zero the continue statement currently jumps to the next iteration of the
while loop and phy_index is never actually incremented, potentially
causing an infinite loop if phy_index is less than SCI_MAX_PHS. Fix this
by turning the while loop into a for loop.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/isci/port_config.c