⬢ DragonFlyBSD Kernel Audit
DF-3774 / fix.diff
← back to finding ↓ download raw
diff --git a/sys/dev/disk/ahci/ahci.c b/sys/dev/disk/ahci/ahci.c
index 0fda0a32..91fa080e 100644
--- a/sys/dev/disk/ahci/ahci.c
+++ b/sys/dev/disk/ahci/ahci.c
@@ -4055,6 +4055,8 @@ ahci_set_feature(struct ahci_port *ap, struct ata_port *atx,
 	at = atx ? atx : ap->ap_ata[0];
 
 	xa = ahci_ata_get_xfer(ap, atx);
+	if (xa == NULL)
+		return (EBUSY);
 
 	xa->fis->type = ATA_FIS_TYPE_H2D;
 	xa->fis->flags = ATA_H2D_FLAGS_CMD | at->at_target;
@@ -4088,6 +4090,8 @@ ahci_read_log(struct ahci_port *ap, struct ata_port *atx,
 	at = atx ? atx : ap->ap_ata[0];
 
 	xa = ahci_ata_get_xfer(ap, atx);
+	if (xa == NULL)
+		return (EBUSY);
 
 	xa->fis->type = ATA_FIS_TYPE_H2D;
 	xa->fis->flags = ATA_H2D_FLAGS_CMD | at->at_target;