diff options
Diffstat (limited to 'drivers/scsi/libata-scsi.c')
-rw-r--r-- | drivers/scsi/libata-scsi.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/scsi/libata-scsi.c b/drivers/scsi/libata-scsi.c index 957a9caee305..7445d8b524d5 100644 --- a/drivers/scsi/libata-scsi.c +++ b/drivers/scsi/libata-scsi.c | |||
@@ -2233,7 +2233,7 @@ ata_scsi_pass_thru(struct ata_queued_cmd *qc, const u8 *scsicmd) | |||
2233 | struct scsi_cmnd *cmd = qc->scsicmd; | 2233 | struct scsi_cmnd *cmd = qc->scsicmd; |
2234 | 2234 | ||
2235 | if ((tf->protocol = ata_scsi_map_proto(scsicmd[1])) == ATA_PROT_UNKNOWN) | 2235 | if ((tf->protocol = ata_scsi_map_proto(scsicmd[1])) == ATA_PROT_UNKNOWN) |
2236 | return 1; | 2236 | goto invalid_fld; |
2237 | 2237 | ||
2238 | /* | 2238 | /* |
2239 | * 12 and 16 byte CDBs use different offsets to | 2239 | * 12 and 16 byte CDBs use different offsets to |
@@ -2295,7 +2295,7 @@ ata_scsi_pass_thru(struct ata_queued_cmd *qc, const u8 *scsicmd) | |||
2295 | */ | 2295 | */ |
2296 | if ((tf->command == ATA_CMD_SET_FEATURES) | 2296 | if ((tf->command == ATA_CMD_SET_FEATURES) |
2297 | && (tf->feature == SETFEATURES_XFER)) | 2297 | && (tf->feature == SETFEATURES_XFER)) |
2298 | return 1; | 2298 | goto invalid_fld; |
2299 | 2299 | ||
2300 | /* | 2300 | /* |
2301 | * Set flags so that all registers will be written, | 2301 | * Set flags so that all registers will be written, |
@@ -2316,6 +2316,11 @@ ata_scsi_pass_thru(struct ata_queued_cmd *qc, const u8 *scsicmd) | |||
2316 | qc->nsect = cmd->bufflen / ATA_SECT_SIZE; | 2316 | qc->nsect = cmd->bufflen / ATA_SECT_SIZE; |
2317 | 2317 | ||
2318 | return 0; | 2318 | return 0; |
2319 | |||
2320 | invalid_fld: | ||
2321 | ata_scsi_set_sense(qc->scsicmd, ILLEGAL_REQUEST, 0x24, 0x00); | ||
2322 | /* "Invalid field in cdb" */ | ||
2323 | return 1; | ||
2319 | } | 2324 | } |
2320 | 2325 | ||
2321 | /** | 2326 | /** |