summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/dev/ata/atapi-cam.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/dev/ata/atapi-cam.c b/sys/dev/ata/atapi-cam.c
index 81c10fc..2a3f787 100644
--- a/sys/dev/ata/atapi-cam.c
+++ b/sys/dev/ata/atapi-cam.c
@@ -167,7 +167,14 @@ atapi_cam_detach_bus(struct ata_channel *ata_ch)
void
atapi_cam_reinit_bus(struct ata_channel *ata_ch) {
struct atapi_xpt_softc *scp = get_softc(ata_ch);
- reinit_bus(scp, RESET);
+
+ /*
+ * scp might be null if the bus is being reinitialised during
+ * the boot-up sequence, before the ATAPI bus is registered.
+ */
+
+ if (scp != NULL)
+ reinit_bus(scp, RESET);
}
static void
OpenPOWER on IntegriCloud