psm: Don't try to detect trackpoint packets if the Elantech device has none

This fixes a panic when `EVDEV_SUPPORT` is enabled: if a trackpoint
packet was detected but there was no trackpoint, we still tried to emit an
evdev event even though the associated relative evdev device (`evdev_r`)
was not initialized.

PR:		225339
MFC after:	1 week
This commit is contained in:
Jean-Sébastien Pédron 2018-01-20 11:21:22 +00:00
parent 9402bd96df
commit b9b766ae47

View File

@ -4187,7 +4187,7 @@ proc_elantech(struct psm_softc *sc, packetbuf_t *pb, mousestatus_t *ms,
/* Determine packet format and do a sanity check for out of sync packets. */
if (ELANTECH_PKT_IS_DEBOUNCE(pb, sc->elanhw.hwversion))
pkt = ELANTECH_PKT_NOP;
else if (ELANTECH_PKT_IS_TRACKPOINT(pb))
else if (sc->elanhw.hastrackpoint && ELANTECH_PKT_IS_TRACKPOINT(pb))
pkt = ELANTECH_PKT_TRACKPOINT;
else
switch (sc->elanhw.hwversion) {