Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'libata-5.16-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata

Pull libata fix from Damien Le Moal:
"A single fix for this cycle:

- Check that ATA16 passthrough commands that do not transfer any data
have a DMA direction set to DMA_NONE (From George)"

* tag 'libata-5.16-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata:
libata: if T_LENGTH is zero, dma direction should be DMA_NONE

+13 -2
+13 -2
drivers/ata/libata-scsi.c
··· 2859 2859 goto invalid_fld; 2860 2860 } 2861 2861 2862 - if (ata_is_ncq(tf->protocol) && (cdb[2 + cdb_offset] & 0x3) == 0) 2863 - tf->protocol = ATA_PROT_NCQ_NODATA; 2862 + if ((cdb[2 + cdb_offset] & 0x3) == 0) { 2863 + /* 2864 + * When T_LENGTH is zero (No data is transferred), dir should 2865 + * be DMA_NONE. 2866 + */ 2867 + if (scmd->sc_data_direction != DMA_NONE) { 2868 + fp = 2 + cdb_offset; 2869 + goto invalid_fld; 2870 + } 2871 + 2872 + if (ata_is_ncq(tf->protocol)) 2873 + tf->protocol = ATA_PROT_NCQ_NODATA; 2874 + } 2864 2875 2865 2876 /* enable LBA */ 2866 2877 tf->flags |= ATA_TFLAG_LBA;