Skip to content
/ linux Public

Commit 18f67e5

Browse files
damien-lemoalgregkh
authored andcommitted
ata: libata-scsi: report correct sense field pointer in ata_scsiop_maint_in()
[ Upstream commit e6d7eba ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent e9b76a8 commit 18f67e5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/ata/libata-scsi.c

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

36123612
if (cdb[2] != 1 && cdb[2] != 3) {
36133613
ata_dev_warn(dev, "invalid command format %d\n", cdb[2]);
3614-
ata_scsi_set_invalid_field(dev, cmd, 1, 0xff);
3614+
ata_scsi_set_invalid_field(dev, cmd, 2, 0xff);
36153615
return 0;
36163616
}
36173617

0 commit comments

Comments
 (0)