Like sd_pr_command, before use sshdr, we need to check whether sshdr is valid. Signed-off-by: zhengbin <zhengbin13@xxxxxxxxxx> --- drivers/scsi/scsi_transport_spi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/scsi/scsi_transport_spi.c b/drivers/scsi/scsi_transport_spi.c index f866106..428f9b8 100644 --- a/drivers/scsi/scsi_transport_spi.c +++ b/drivers/scsi/scsi_transport_spi.c @@ -124,6 +124,7 @@ static int spi_execute(struct scsi_device *sdev, const void *cmd, REQ_FAILFAST_DRIVER, 0, NULL); if (driver_byte(result) != DRIVER_SENSE || + !scsi_sense_valid(sshdr) || sshdr->sense_key != UNIT_ATTENTION) break; } -- 2.7.4