Commit 2e5991fa authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull ATA fix from Damien Le Moal:
 "A single fix to avoid a NULL pointer dereference in the pata_marvell
  driver with adapters not supporting DMA, from Zheyu"

* tag 'ata-5.18-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata:
  ata: pata_marvell: Check the 'bmdma_addr' beforing reading
parents bb4ce2c6 aafa9f95
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -77,6 +77,8 @@ static int marvell_cable_detect(struct ata_port *ap)
	switch(ap->port_no)
	{
	case 0:
		if (!ap->ioaddr.bmdma_addr)
			return ATA_CBL_PATA_UNK;
		if (ioread8(ap->ioaddr.bmdma_addr + 1) & 1)
			return ATA_CBL_PATA40;
		return ATA_CBL_PATA80;