brcmfmac: remove 'always false' condition from brcmf_c_mkiovar_bsscfg
authorArend van Spriel <[email protected]>
Wed, 10 Oct 2012 18:13:11 +0000 (11:13 -0700)
committerJohn W. Linville <[email protected]>
Fri, 19 Oct 2012 20:20:03 +0000 (16:20 -0400)
The parameter buflen is unsigned so the condition buflen < 0 is
always false. The patch fixes the if statement checking the buffer
length.

Reported-by: Dan Carpenter <[email protected]>
Reviewed-by: Pieter-Paul Giesberts <[email protected]>
Reviewed-by: Hante Meuleman <[email protected]>
Signed-off-by: Arend van Spriel <[email protected]>
Signed-off-by: Franky Lin <[email protected]>
Signed-off-by: John W. Linville <[email protected]>
drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c

index 15c5db5752d199d2ec4c78913c44a5713dfb78a8..a081e683743b37e9044f7001d519747522af2614 100644 (file)
@@ -106,7 +106,7 @@ brcmf_c_mkiovar_bsscfg(char *name, char *data, uint datalen,
        namelen = (u32) strlen(name) + 1; /* lengh of iovar  name + null */
        iolen = prefixlen + namelen + sizeof(bssidx_le) + datalen;
 
-       if (buflen < 0 || iolen > (u32)buflen) {
+       if ((u32)buflen < iolen) {
                brcmf_dbg(ERROR, "buffer is too short\n");
                return 0;
        }