[scsi] Avoid duplicate call to scsicmd_close() on TEST UNIT READY failure
authorMichael Brown <mcb30@ipxe.org>
Sun, 26 Mar 2017 08:21:14 +0000 (11:21 +0300)
committerMichael Brown <mcb30@ipxe.org>
Sun, 26 Mar 2017 08:29:18 +0000 (11:29 +0300)
commit6bc4a8ac918b2dc5a460b3d2032055d8f7a478ff
tree1c83dc72a70f4cbb86dc3fbbfb8d2a8d03cd9adf
parentc13bf525098949291cf930d5c87da5c51c812af4
[scsi] Avoid duplicate call to scsicmd_close() on TEST UNIT READY failure

When the TEST UNIT READY command receives an error response, the
shutdown of the command's block data interface will result in
scsidev_ready() closing the SCSI device.  This will subsequently
result in a duplicate call to scsicmd_close(), leading to an assertion
failure when list_del() is called for the second time.

Fix by removing the command from the list of outstanding commands
before shutting down the command's interfaces.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/drivers/block/scsi.c