Skip to content

Commit b6c49fc

Browse files
committed
Merge tag 'ata-6.12-rc1-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/libata/linux
Pull ata fixes from Damien Le Moal: - Fix a NULL pointer dereference introduced by the recent cleanups of the command duration limits feature handling (me) - Fix incorrect generation of the mode sense data for the ALL_SUB_MPAGES page (me) * tag 'ata-6.12-rc1-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/libata/linux: ata: libata-scsi: Fix ata_msense_control() CDL page reporting ata: libata-scsi: Fix ata_msense_control_spgt2()
2 parents e5f0e38 + 0e9a299 commit b6c49fc

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

drivers/ata/libata-scsi.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2256,10 +2256,15 @@ static inline u16 ata_xlat_cdl_limit(u8 *buf)
22562256
static unsigned int ata_msense_control_spgt2(struct ata_device *dev, u8 *buf,
22572257
u8 spg)
22582258
{
2259-
u8 *b, *cdl = dev->cdl->desc_log_buf, *desc;
2259+
u8 *b, *cdl, *desc;
22602260
u32 policy;
22612261
int i;
22622262

2263+
if (!(dev->flags & ATA_DFLAG_CDL) || !dev->cdl)
2264+
return 0;
2265+
2266+
cdl = dev->cdl->desc_log_buf;
2267+
22632268
/*
22642269
* Fill the subpage. The first four bytes of the T2A/T2B mode pages
22652270
* are a header. The PAGE LENGTH field is the size of the page
@@ -2356,7 +2361,7 @@ static unsigned int ata_msense_control(struct ata_device *dev, u8 *buf,
23562361
case ALL_SUB_MPAGES:
23572362
n = ata_msense_control_spg0(dev, buf, changeable);
23582363
n += ata_msense_control_spgt2(dev, buf + n, CDL_T2A_SUB_MPAGE);
2359-
n += ata_msense_control_spgt2(dev, buf + n, CDL_T2A_SUB_MPAGE);
2364+
n += ata_msense_control_spgt2(dev, buf + n, CDL_T2B_SUB_MPAGE);
23602365
n += ata_msense_control_ata_feature(dev, buf + n);
23612366
return n;
23622367
default:

0 commit comments

Comments
 (0)