From c776fcd4e1ed5daac6c310c7262a889ec03277ed Mon Sep 17 00:00:00 2001 From: wulf Date: Thu, 19 Oct 2017 21:07:28 +0000 Subject: [PATCH] psm(4): Add sanity checks to Synaptics touchpad driver resolution parser. This fixes "Kernel has only x or y resolution, not both" libinput error. Reported by: Ivan Tested by: Ivan Approved by: gonzo (mentor) MFC after: 2 weeks --- sys/dev/atkbdc/psm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/dev/atkbdc/psm.c b/sys/dev/atkbdc/psm.c index c077a68190e9..608e4c58f0f0 100644 --- a/sys/dev/atkbdc/psm.c +++ b/sys/dev/atkbdc/psm.c @@ -6094,8 +6094,10 @@ enable_synaptics(struct psm_softc *sc, enum probearg arg) if (get_mouse_status(kbdc, status, 0, 3) != 3) return (FALSE); - synhw.infoXupmm = status[0]; - synhw.infoYupmm = status[2]; + if (status[0] != 0 && (status[1] & 0x80) && status[2] != 0) { + synhw.infoXupmm = status[0]; + synhw.infoYupmm = status[2]; + } if (verbose >= 2) { printf(" Extended capabilities:\n");