diff options
author | Christopher Pascoe <pascoe@cvs.openbsd.org> | 2007-03-28 06:19:49 +0000 |
---|---|---|
committer | Christopher Pascoe <pascoe@cvs.openbsd.org> | 2007-03-28 06:19:49 +0000 |
commit | 62cc7a63e70b9692d050683f1decfcf3aa00d51a (patch) | |
tree | 69649c08a2bf616ddf0c95c0d605045cbdc09ffb /sys/dev/pci/ahci.c | |
parent | 917a3d35b48887b8fd22c84cb90f82da5c35f8f0 (diff) |
Some more safety checks on ccb state.
Diffstat (limited to 'sys/dev/pci/ahci.c')
-rw-r--r-- | sys/dev/pci/ahci.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/dev/pci/ahci.c b/sys/dev/pci/ahci.c index 9f87d4347c2..8c8dccab6db 100644 --- a/sys/dev/pci/ahci.c +++ b/sys/dev/pci/ahci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ahci.c,v 1.99 2007/03/27 07:31:15 dlg Exp $ */ +/* $OpenBSD: ahci.c,v 1.100 2007/03/28 06:19:48 pascoe Exp $ */ /* * Copyright (c) 2006 David Gwynne <dlg@openbsd.org> @@ -1740,6 +1740,7 @@ ahci_get_ccb(struct ahci_port *ap) ccb = TAILQ_FIRST(&ap->ap_ccb_free); if (ccb != NULL) { + KASSERT(ccb->ccb_xa.state == ATA_S_PUT); TAILQ_REMOVE(&ap->ap_ccb_free, ccb, ccb_entry); ccb->ccb_xa.state = ATA_S_SETUP; } @@ -1971,6 +1972,8 @@ ahci_ata_cmd(struct ata_xfer *xa) struct ahci_cmd_hdr *cmd_slot; int s; + KASSERT(xa->state == ATA_S_SETUP); + if (ccb->ccb_port->ap_state == AP_S_FATAL_ERROR) goto failcmd; |