Commit 2e1268af authored by Dan Carpenter's avatar Dan Carpenter Committed by Khalid Elmously

cw1200: Fix a signedness bug in cw1200_load_firmware()

BugLink: https://bugs.launchpad.net/bugs/1860681

commit 4a50d454 upstream.

The "priv->hw_type" is an enum and in this context GCC will treat it
as an unsigned int so the error handling will never trigger.

Fixes: a910e4a9 ("cw1200: add driver for the ST-E CW1100 & CW1200 WLAN chipsets")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarConnor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
parent de673dfd
......@@ -323,12 +323,12 @@ int cw1200_load_firmware(struct cw1200_common *priv)
goto out;
}
priv->hw_type = cw1200_get_hw_type(val32, &major_revision);
if (priv->hw_type < 0) {
ret = cw1200_get_hw_type(val32, &major_revision);
if (ret < 0) {
pr_err("Can't deduce hardware type.\n");
ret = -ENOTSUPP;
goto out;
}
priv->hw_type = ret;
/* Set DPLL Reg value, and read back to confirm writes work */
ret = cw1200_reg_write_32(priv, ST90TDS_TSET_GEN_R_W_REG_ID,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment