]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
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)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 1 Oct 2018 12:55:26 +0000 (14:55 +0200)
commitce71e6d34c54c3f29b060e0085e44ceaf1e47729
tree96f67de8f5a5ac0794e8f167ba66dee940fef85e
parentd35e84a48b2f3706fd21f28fe381ebd40c37840f
scsi: isci: Fix infinite loop in while loop

BugLink: http://bugs.launchpad.net/bugs/1794889
[ Upstream commit 4bc83b3f272fe8f36450f9c003df49cf07ffe5fd ]

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>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/scsi/isci/port_config.c