Skip to content

Commit e6d7eba

Browse files
damien-lemoalfloatious
authored andcommitted
ata: libata-scsi: report correct sense field pointer in ata_scsiop_maint_in()
Commit 4ab7bb9 ("ata: libata-scsi: Refactor ata_scsiop_maint_in()") modified ata_scsiop_maint_in() to directly call ata_scsi_set_invalid_field() to set the field pointer of the sense data of a failed MAINTENANCE IN command. However, in the case of an invalid command format, the sense data field incorrectly indicates byte 1 of the CDB. Fix this to indicate byte 2 of the command. Reported-by: Guenter Roeck <linux@roeck-us.net> Fixes: 4ab7bb9 ("ata: libata-scsi: Refactor ata_scsiop_maint_in()") Cc: stable@vger.kernel.org Signed-off-by: Damien Le Moal <dlemoal@kernel.org> Signed-off-by: Niklas Cassel <cassel@kernel.org>
1 parent ce5ae93 commit e6d7eba

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/ata/libata-scsi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3600,7 +3600,7 @@ static unsigned int ata_scsiop_maint_in(struct ata_device *dev,
36003600

36013601
if (cdb[2] != 1 && cdb[2] != 3) {
36023602
ata_dev_warn(dev, "invalid command format %d\n", cdb[2]);
3603-
ata_scsi_set_invalid_field(dev, cmd, 1, 0xff);
3603+
ata_scsi_set_invalid_field(dev, cmd, 2, 0xff);
36043604
return 0;
36053605
}
36063606

0 commit comments

Comments
 (0)