summaryrefslogtreecommitdiff
path: root/sys/dev/ata/ata-all.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/ata/ata-all.c')
-rw-r--r--sys/dev/ata/ata-all.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/ata/ata-all.c b/sys/dev/ata/ata-all.c
index f1d534e58a21..3ae73360b935 100644
--- a/sys/dev/ata/ata-all.c
+++ b/sys/dev/ata/ata-all.c
@@ -1250,13 +1250,15 @@ sysctl_hw_ata SYSCTL_HANDLER_ARGS
i = 0;
while (*ptr) {
if (!strncmp(ptr, "pio", 3) || !strncmp(ptr, "PIO", 3)) {
- if (atadevices[i >> 1]->dev_softc[i & 1] &&
+ if (atadevices[i >> 1] &&
+ atadevices[i >> 1]->dev_softc[i & 1] &&
atadevices[i >>1 ]->mode[i & 1] >= ATA_DMA)
ata_change_mode(atadevices[i >> 1],
(i & 1) ? ATA_SLAVE : ATA_MASTER, ATA_PIO);
}
else if (!strncmp(ptr, "dma", 3) || !strncmp(ptr, "DMA", 3)) {
- if (atadevices[i >> 1]->dev_softc[i & 1] &&
+ if (atadevices[i >> 1] &&
+ atadevices[i >> 1]->dev_softc[i & 1] &&
atadevices[i >> 1]->mode[i & 1] < ATA_DMA)
ata_change_mode(atadevices[i >> 1],
(i & 1) ? ATA_SLAVE : ATA_MASTER, ATA_DMA);