]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ata: libata-scsi: Fix ata_msense_control() CDL page reporting
authorDamien Le Moal <dlemoal@kernel.org>
Mon, 23 Sep 2024 09:14:36 +0000 (18:14 +0900)
committerDamien Le Moal <dlemoal@kernel.org>
Tue, 24 Sep 2024 07:56:51 +0000 (16:56 +0900)
When the user requests the ALL_SUB_MPAGES mode sense page,
ata_msense_control() adds the CDL_T2A_SUB_MPAGE twice instead of adding
the CDL_T2A_SUB_MPAGE and CDL_T2B_SUB_MPAGE pages information. Correct
the second call to ata_msense_control_spgt2() to report the
CDL_T2B_SUB_MPAGE page.

Fixes: 673b2fe6ff1d ("scsi: ata: libata-scsi: Add support for CDL pages mode sense")
Cc: stable@vger.kernel.org
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Hannes Reinecke <hare@suse.de>
drivers/ata/libata-scsi.c

index 97c84b0ec4725d4b1c9cea2ece81d1210b1a5257..ea7d365fb7a91cfa21129d3981ab5be86cc2a17e 100644 (file)
@@ -2350,7 +2350,7 @@ static unsigned int ata_msense_control(struct ata_device *dev, u8 *buf,
        case ALL_SUB_MPAGES:
                n = ata_msense_control_spg0(dev, buf, changeable);
                n += ata_msense_control_spgt2(dev, buf + n, CDL_T2A_SUB_MPAGE);
-               n += ata_msense_control_spgt2(dev, buf + n, CDL_T2A_SUB_MPAGE);
+               n += ata_msense_control_spgt2(dev, buf + n, CDL_T2B_SUB_MPAGE);
                n += ata_msense_control_ata_feature(dev, buf + n);
                return n;
        default: