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

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()

+7 -2
+7 -2
drivers/ata/libata-scsi.c
··· 2256 2256 static unsigned int ata_msense_control_spgt2(struct ata_device *dev, u8 *buf, 2257 2257 u8 spg) 2258 2258 { 2259 - u8 *b, *cdl = dev->cdl->desc_log_buf, *desc; 2259 + u8 *b, *cdl, *desc; 2260 2260 u32 policy; 2261 2261 int i; 2262 + 2263 + if (!(dev->flags & ATA_DFLAG_CDL) || !dev->cdl) 2264 + return 0; 2265 + 2266 + cdl = dev->cdl->desc_log_buf; 2262 2267 2263 2268 /* 2264 2269 * Fill the subpage. The first four bytes of the T2A/T2B mode pages ··· 2361 2356 case ALL_SUB_MPAGES: 2362 2357 n = ata_msense_control_spg0(dev, buf, changeable); 2363 2358 n += ata_msense_control_spgt2(dev, buf + n, CDL_T2A_SUB_MPAGE); 2364 - n += ata_msense_control_spgt2(dev, buf + n, CDL_T2A_SUB_MPAGE); 2359 + n += ata_msense_control_spgt2(dev, buf + n, CDL_T2B_SUB_MPAGE); 2365 2360 n += ata_msense_control_ata_feature(dev, buf + n); 2366 2361 return n; 2367 2362 default: