I noticed that Intel AMT Serial-over-LAN prints the following:

puc0 at pci0 dev 22 function 3 "Intel 9 Series KT" rev 0x03: ports: 16 com

Now there certainly is only 1 com port on the device instead of 16 and
this is caused by a buglet in the code where it inadvertedly considers
"empty" entries in the pucdata table as com ports.  The diff below
fixes this.

ok?


Index: dev/pci/pucvar.h
===================================================================
RCS file: /cvs/src/sys/dev/pci/pucvar.h,v
retrieving revision 1.16
diff -u -p -r1.16 pucvar.h
--- dev/pci/pucvar.h    2 May 2018 19:11:01 -0000       1.16
+++ dev/pci/pucvar.h    5 May 2019 10:54:07 -0000
@@ -75,7 +75,7 @@ static const struct puc_port_type puc_po
 };
 
 #define PUC_IS_LPT(type)       ((type) == PUC_PORT_LPT)
-#define PUC_IS_COM(type)       ((type) != PUC_PORT_LPT)
+#define PUC_IS_COM(type)       ((type) && (type) != PUC_PORT_LPT)
 
 #define PUC_PORT_BAR_INDEX(bar)        (((bar) - PCI_MAPREG_START) / 4)
 

Reply via email to