aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/ata/libata-scsi.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 94144ed50a6b..a45f6ac3b245 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -2869,7 +2869,8 @@ static inline int __ata_scsi_queuecmd(struct scsi_cmnd *scmd,
2869 xlat_func = NULL; 2869 xlat_func = NULL;
2870 if (likely((scsi_op != ATA_16) || !atapi_passthru16)) { 2870 if (likely((scsi_op != ATA_16) || !atapi_passthru16)) {
2871 /* relay SCSI command to ATAPI device */ 2871 /* relay SCSI command to ATAPI device */
2872 if (unlikely(scmd->cmd_len > dev->cdb_len)) 2872 int len = COMMAND_SIZE(scsi_op);
2873 if (unlikely(len > scmd->cmd_len || len > dev->cdb_len))
2873 goto bad_cdb_len; 2874 goto bad_cdb_len;
2874 2875
2875 xlat_func = atapi_xlat; 2876 xlat_func = atapi_xlat;