Commit b6c49fca authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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()
parents e5f0e38e 0e9a2990
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -2256,10 +2256,15 @@ static inline u16 ata_xlat_cdl_limit(u8 *buf)
static unsigned int ata_msense_control_spgt2(struct ata_device *dev, u8 *buf,
					     u8 spg)
{
	u8 *b, *cdl = dev->cdl->desc_log_buf, *desc;
	u8 *b, *cdl, *desc;
	u32 policy;
	int i;

	if (!(dev->flags & ATA_DFLAG_CDL) || !dev->cdl)
		return 0;

	cdl = dev->cdl->desc_log_buf;

	/*
	 * Fill the subpage. The first four bytes of the T2A/T2B mode pages
	 * 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,
	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: