Skip to content

Commit 4a50d45

Browse files
Dan CarpenterKalle Valo
authored andcommitted
cw1200: Fix a signedness bug in cw1200_load_firmware()
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: a910e4a ("cw1200: add driver for the ST-E CW1100 & CW1200 WLAN chipsets") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
1 parent bcde60e commit 4a50d45

File tree

1 file changed

+3
-3
lines changed
  • drivers/net/wireless/st/cw1200

1 file changed

+3
-3
lines changed

drivers/net/wireless/st/cw1200/fwio.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -320,12 +320,12 @@ int cw1200_load_firmware(struct cw1200_common *priv)
320320
goto out;
321321
}
322322

323-
priv->hw_type = cw1200_get_hw_type(val32, &major_revision);
324-
if (priv->hw_type < 0) {
323+
ret = cw1200_get_hw_type(val32, &major_revision);
324+
if (ret < 0) {
325325
pr_err("Can't deduce hardware type.\n");
326-
ret = -ENOTSUPP;
327326
goto out;
328327
}
328+
priv->hw_type = ret;
329329

330330
/* Set DPLL Reg value, and read back to confirm writes work */
331331
ret = cw1200_reg_write_32(priv, ST90TDS_TSET_GEN_R_W_REG_ID,

0 commit comments

Comments
 (0)