⬢ DragonFlyBSD Kernel Audit
DF-4044 / fix.diff
← back to finding ↓ download raw
--- a/sys/dev/disk/amd/amd.c
+++ b/sys/dev/disk/amd/amd.c
@@ -1215,8 +1215,10 @@
 	 */
 	switch (amd->msgin_buf[0]) {
 	case MSG_DISCONNECT:
-		amd->active_srb->SRBState = SRB_DISCONNECT;
-		amd->disc_count[amd->cur_target][amd->cur_lun]++;
+		if (amd->active_srb != NULL) {
+			amd->active_srb->SRBState = SRB_DISCONNECT;
+			amd->disc_count[amd->cur_target][amd->cur_lun]++;
+		}
 		done = TRUE;
 		break;
 	case MSG_SIMPLE_Q_TAG: