From: miod Date: Wed, 19 Apr 2023 04:51:53 +0000 (+0000) Subject: Remove strict checks added in 1.22, for they break some sensors. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=6c86630a4ed627ec7e0f19be1d53395551d45256;p=openbsd Remove strict checks added in 1.22, for they break some sensors. Reported by Paul de Weerd on bugs@ --- diff --git a/sys/dev/usb/ugold.c b/sys/dev/usb/ugold.c index 14a0cbb687d..bfc155b86b9 100644 --- a/sys/dev/usb/ugold.c +++ b/sys/dev/usb/ugold.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ugold.c,v 1.22 2023/04/02 17:03:14 miod Exp $ */ +/* $OpenBSD: ugold.c,v 1.23 2023/04/19 04:51:53 miod Exp $ */ /* * Copyright (c) 2013 Takayoshi SASANO @@ -427,12 +427,10 @@ ugold_si700x_intr(struct uhidev *addr, void *ibuf, u_int len) if (buf[1] != 4 && buf[1] != 64 && buf[1] != 128) printf("%s: invalid data length (%d bytes)\n", sc->sc_hdev.sc_dev.dv_xname, buf[1]); - if (buf[1] < 4) - break; temp = ugold_si700x_temp(sc->sc_type, buf[2], buf[3]); sc->sc_sensor[UGOLD_INNER].value = (temp * 1000) + 273150000; sc->sc_sensor[UGOLD_INNER].flags &= ~SENSOR_FINVALID; - if (sc->sc_type != UGOLD_TYPE_GOLD && buf[1] >= 6) { + if (sc->sc_type != UGOLD_TYPE_GOLD) { rhum = ugold_si700x_rhum(sc->sc_type, buf[4], buf[5], temp); sc->sc_sensor[UGOLD_HUM].value = rhum; sc->sc_sensor[UGOLD_HUM].flags &= ~SENSOR_FINVALID;