diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2022-04-22 18:09:49 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2022-04-22 18:09:49 -0700 |
commit | 2e5991fa39e4eec45eb37a680bfdff18129cefd9 (patch) | |
tree | 667964db22983d925c70ba16ee1f13fae6a6fea2 /drivers | |
parent | bb4ce2c65881a2b9bdcd384f54a260a12a89dd91 (diff) | |
parent | aafa9f958342db36c17ac2a7f1b841032c96feb4 (diff) | |
download | linux-2e5991fa39e4eec45eb37a680bfdff18129cefd9.tar.bz2 |
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
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ata/pata_marvell.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/ata/pata_marvell.c b/drivers/ata/pata_marvell.c index 0c5a51970fbf..014ccb0f45dc 100644 --- a/drivers/ata/pata_marvell.c +++ b/drivers/ata/pata_marvell.c @@ -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; |