You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
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>
This commit is contained in:
@@ -2792,8 +2792,9 @@ static inline int __ata_scsi_queuecmd(struct scsi_cmnd *scmd,
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
if (unlikely(!scmd->cmd_len)) {
|
||||
ata_dev_printk(dev, KERN_WARNING, "WARNING: zero len CDB\n");
|
||||
if (unlikely(!scmd->cmd_len || scmd->cmd_len > dev->cdb_len)) {
|
||||
DPRINTK("bad CDB len=%u, max=%u\n",
|
||||
scmd->cmd_len, dev->cdb_len);
|
||||
scmd->result = DID_ERROR << 16;
|
||||
done(scmd);
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user