Skip to content

Commit 2e5991f

Browse files
committed
Merge tag 'ata-5.18-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata
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
2 parents bb4ce2c + aafa9f9 commit 2e5991f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/ata/pata_marvell.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ static int marvell_cable_detect(struct ata_port *ap)
7777
switch(ap->port_no)
7878
{
7979
case 0:
80+
if (!ap->ioaddr.bmdma_addr)
81+
return ATA_CBL_PATA_UNK;
8082
if (ioread8(ap->ioaddr.bmdma_addr + 1) & 1)
8183
return ATA_CBL_PATA40;
8284
return ATA_CBL_PATA80;

0 commit comments

Comments
 (0)