From a52b2e8781788ea3320200146c65ce05fb18b335 Mon Sep 17 00:00:00 2001 From: stsp Date: Tue, 1 Jun 2021 12:33:54 +0000 Subject: [PATCH] Fix iwx(4) firmware reloading after a failure to parse the firmware file. Noticed by Peter N. M. Hansteen This issue will also be fixed in iwm(4) soon, along with a firmware update. --- sys/dev/pci/if_iwx.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/dev/pci/if_iwx.c b/sys/dev/pci/if_iwx.c index 603040437b7..2c9a2179d4c 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.57 2021/05/31 08:43:07 stsp Exp $ */ +/* $OpenBSD: if_iwx.c,v 1.58 2021/06/01 12:33:54 stsp Exp $ */ /* * Copyright (c) 2014, 2016 genua gmbh @@ -987,6 +987,8 @@ iwx_read_firmware(struct iwx_softc *sc) sc->sc_capaflags = 0; sc->sc_capa_n_scan_channels = IWX_DEFAULT_SCAN_CHANNELS; memset(sc->sc_enabled_capa, 0, sizeof(sc->sc_enabled_capa)); + memset(sc->sc_ucode_api, 0, sizeof(sc->sc_ucode_api)); + sc->n_cmd_versions = 0; uhdr = (void *)fw->fw_rawdata; if (*(uint32_t *)fw->fw_rawdata != 0 -- 2.20.1