scsi: qedi: Fix list_del corruption while removing active I/O
authorNilesh Javali <njavali@marvell.com>
Tue, 8 Sep 2020 09:56:52 +0000 (02:56 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 9 Sep 2020 02:40:21 +0000 (22:40 -0400)
commit28b35d17f9f8573d4646dd8df08917a4076a6b63
treeb20c5c823cc7da3823814cd456195c94284eebd1
parent5c35e46465665e2864b2f76675306bf06e0b8703
scsi: qedi: Fix list_del corruption while removing active I/O

While aborting the I/O, the firmware cleanup task timed out and driver
deleted the I/O from active command list. Some time later the firmware
sent the cleanup task response and driver again deleted the I/O from
active command list causing firmware to send completion for non-existent
I/O and list_del corruption of active command list.

Add fix to check if I/O is present before deleting it from the active
command list to ensure firmware sends valid I/O completion and protect
against list_del corruption.

Link: https://lore.kernel.org/r/20200908095657.26821-4-mrangankar@marvell.com
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Manish Rangankar <mrangankar@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/qedi/qedi_fw.c