diff options
author | Stefan Sperling <stsp@cvs.openbsd.org> | 2021-07-18 11:56:12 +0000 |
---|---|---|
committer | Stefan Sperling <stsp@cvs.openbsd.org> | 2021-07-18 11:56:12 +0000 |
commit | 0d14d9544b153488974f328b0e64a24add22090d (patch) | |
tree | 7966362bc205e06fc430d77ce015bca473e8f581 /sys | |
parent | b91ffd95d0f25873a031fe4a3a234ed97a8e9845 (diff) |
Fix wrong usage of iwx_lookup_cmd_ver() in iwx_send_soc_conf().
Callers are supposed to check whether iwx_lookup_cmd_ver() returns
CMD_VER_UNKNOWN, and this check was missing here. Fortunately, the
buggy check was part of a condition which also requires the
low_latency_xtal constant to be set. We do not yet support devices
where low_latency_xtal is non-zero, so the bug never triggered.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/if_iwx.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/pci/if_iwx.c b/sys/dev/pci/if_iwx.c index 406042ab42f..cd019fc4890 100644 --- a/sys/dev/pci/if_iwx.c +++ b/sys/dev/pci/if_iwx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwx.c,v 1.64 2021/07/18 11:40:31 stsp Exp $ */ +/* $OpenBSD: if_iwx.c,v 1.65 2021/07/18 11:56:11 stsp Exp $ */ /* * Copyright (c) 2014, 2016 genua gmbh <info@genua.de> @@ -7201,7 +7201,8 @@ iwx_send_soc_conf(struct iwx_softc *sc) IWX_SOC_FLAGS_LTR_APPLY_DELAY_MASK); scan_cmd_ver = iwx_lookup_cmd_ver(sc, IWX_LONG_GROUP, IWX_SCAN_REQ_UMAC); - if (scan_cmd_ver >= 2 && sc->sc_low_latency_xtal) + if (scan_cmd_ver != IWX_FW_CMD_VER_UNKNOWN && + scan_cmd_ver >= 2 && sc->sc_low_latency_xtal) flags |= IWX_SOC_CONFIG_CMD_FLAGS_LOW_LATENCY; } cmd.flags = htole32(flags); |