diff options
author | Mark Lord <liml@rtr.ca> | 2007-02-02 12:36:25 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-04-28 14:15:55 -0400 |
commit | f0ef88ed413232daebfe675c7b1bbf100d604d4b (patch) | |
tree | fc235d7aede0d6c4d2e500ef5d0446122eaa611a /drivers/ata/libata-scsi.c | |
parent | cd0d3bbcdd650651b7ccfaf55d107e3fc237d95a (diff) |
RESEND: libata: check cdb len per dev instead of per host
Resending, with s/printk/DPRINTK/ as pointed out by Alan.
Fix libata to perform CDB len validation per device
rather than per host. This way, validation still works
when we have a mix of 12-byte and 16-byte devices on
a common host interface.
Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/libata-scsi.c')
-rw-r--r-- | drivers/ata/libata-scsi.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index e9364434182c..7d41afe8ccbc 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c | |||
@@ -2792,8 +2792,9 @@ static inline int __ata_scsi_queuecmd(struct scsi_cmnd *scmd, | |||
2792 | { | 2792 | { |
2793 | int rc = 0; | 2793 | int rc = 0; |
2794 | 2794 | ||
2795 | if (unlikely(!scmd->cmd_len)) { | 2795 | if (unlikely(!scmd->cmd_len || scmd->cmd_len > dev->cdb_len)) { |
2796 | ata_dev_printk(dev, KERN_WARNING, "WARNING: zero len CDB\n"); | 2796 | DPRINTK("bad CDB len=%u, max=%u\n", |
2797 | scmd->cmd_len, dev->cdb_len); | ||
2797 | scmd->result = DID_ERROR << 16; | 2798 | scmd->result = DID_ERROR << 16; |
2798 | done(scmd); | 2799 | done(scmd); |
2799 | return 0; | 2800 | return 0; |