⬢ DragonFlyBSD Kernel Audit
DF-2344 / fix_2344.diff
← back to finding ↓ download raw
--- a/sys/bus/u4b/serial/umcs.c
+++ b/sys/bus/u4b/serial/umcs.c
@@ -321,7 +321,10 @@
 	 *
 	 * Also, see notes in header file for these constants.
 	 */
-	umcs7840_get_reg_sync(sc, MCS7840_DEV_REG_GPIO, &data);
+	if (umcs7840_get_reg_sync(sc, MCS7840_DEV_REG_GPIO, &data)) {
+		device_printf(dev, "failed to read GPIO register\n");
+		goto detach;
+	}
 	if (data & MCS7840_DEV_GPIO_4PORTS) {
 		sc->sc_numports = 4;
 		/* Store physical port numbers in sc_portno */