summaryrefslogtreecommitdiffstats
path: root/sys/dev/ata/atapi-cam.c
diff options
context:
space:
mode:
authorthomas <thomas@FreeBSD.org>2003-05-14 14:20:22 +0000
committerthomas <thomas@FreeBSD.org>2003-05-14 14:20:22 +0000
commit5608416700cee9cc7d38c7150d31aba7ee37cf53 (patch)
treea6c62f42d93d414f225d88f383f17215092e6d65 /sys/dev/ata/atapi-cam.c
parentfef83dc8be41b6e2e7152bbd08d65d6acb591380 (diff)
downloadFreeBSD-src-5608416700cee9cc7d38c7150d31aba7ee37cf53.zip
FreeBSD-src-5608416700cee9cc7d38c7150d31aba7ee37cf53.tar.gz
In atapi_cam_reinit_bus, only call reinit_bus if the ATAPI channel
has already been registered with ATAPI/CAM (else there is nothing to do). atapi_cam_reinit_bus may be called before the bus is registered if an ATAPI command times out during the boot sequence. PR: i386/51421 Reviewed by: roberto Approved by: re (rwatson) MFC after: 1 week
Diffstat (limited to 'sys/dev/ata/atapi-cam.c')
-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