Module Name:    src
Committed By:   thorpej
Date:           Sat Oct 10 20:27:55 UTC 2020

Modified Files:
        src/sys/dev/ic: siisata.c

Log Message:
In siisata_intr_port(), skip reading the error condition if
ata_queue_get_active_xfer() returns NULL.

PR kern/55682.  Fix suggested by mlelstv@.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/dev/ic/siisata.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/siisata.c
diff -u src/sys/dev/ic/siisata.c:1.42 src/sys/dev/ic/siisata.c:1.43
--- src/sys/dev/ic/siisata.c:1.42	Mon Apr 13 10:49:34 2020
+++ src/sys/dev/ic/siisata.c	Sat Oct 10 20:27:54 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: siisata.c,v 1.42 2020/04/13 10:49:34 jdolecek Exp $ */
+/* $NetBSD: siisata.c,v 1.43 2020/10/10 20:27:54 thorpej Exp $ */
 
 /* from ahcisata_core.c */
 
@@ -79,7 +79,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: siisata.c,v 1.42 2020/04/13 10:49:34 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: siisata.c,v 1.43 2020/10/10 20:27:54 thorpej Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -540,10 +540,9 @@ siisata_intr_port(struct siisata_channel
 		tfd = ATACH_ERR_ST(WDCE_CRC, WDCS_ERR);
 
 		if (ec <= PR_PCE_DATAFISERROR) {
-			if (ec == PR_PCE_DEVICEERROR
-			    && (chp->ch_flags & ATACH_NCQ) == 0) {
-				xfer = ata_queue_get_active_xfer(chp);
-
+			if (ec == PR_PCE_DEVICEERROR &&
+			    (chp->ch_flags & ATACH_NCQ) == 0 &&
+			    (xfer = ata_queue_get_active_xfer(chp)) != NULL) {
 				/* read in specific information about error */
 				uint32_t prbfis = bus_space_read_stream_4(
 				    sc->sc_prt, sc->sc_prh,

Reply via email to