From 0cd7fa558eb60138680828fd487f4c99eb7647b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Imre=20Vad=C3=A1sz?= Date: Mon, 19 Sep 2016 22:13:08 +0000 Subject: [PATCH] [iwm] Fix iwm_poll_bit() error value check in iwm_attach(). The iwm(4) iwm_poll_bit() function returns 1 on success, and 0 on failure, whereas the iwl_poll_bit() in Linux iwlwifi returns < 0 on failure. So the (ret < 0) check ended up ignoring any error returned by iwm_poll_bit(). Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D7932 --- sys/dev/iwm/if_iwm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/iwm/if_iwm.c b/sys/dev/iwm/if_iwm.c index aa1245d05e2..f6e1588d064 100644 --- a/sys/dev/iwm/if_iwm.c +++ b/sys/dev/iwm/if_iwm.c @@ -5762,7 +5762,7 @@ iwm_attach(device_t dev) IWM_CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, IWM_CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000); - if (ret < 0) { + if (!ret) { device_printf(sc->sc_dev, "Failed to wake up the nic\n"); goto fail;