]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 4 Oct 2024 14:38:38 +0000 (16:38 +0200)
commit 0e9a2990a93f27daa643b6fa73cfa47b128947a7 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/ata/libata-scsi.c

index fc8d99ea2e581f419e411372cbfc1c1387dcf234..74f7053f01a13894e2d3a8f2f78697e4699421dd 100644 (file)
@@ -2356,7 +2356,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: