]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
brcmsmac: fix brcms_c_country_valid()
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 12 Feb 2013 12:23:14 +0000 (15:23 +0300)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 14 Feb 2013 19:24:06 +0000 (14:24 -0500)
ccode is not NUL terminated.  Presumably insisting on a terminator makes
brcms_c_country_valid() return false when it's not intended.  ccode[2]
is sprom->leddc_on_time.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/brcm80211/brcmsmac/channel.c

index cdb62b8ccc79c6c6ad6ea68269d3f03008d6e3e3..10ee314c42298a7d1d2e7264ae8093d36ed586a2 100644 (file)
@@ -183,8 +183,7 @@ static bool brcms_c_country_valid(const char *ccode)
         * chars.
         */
        if (!((0x80 & ccode[0]) == 0 && ccode[0] >= 0x41 && ccode[0] <= 0x5A &&
-             (0x80 & ccode[1]) == 0 && ccode[1] >= 0x41 && ccode[1] <= 0x5A &&
-             ccode[2] == '\0'))
+             (0x80 & ccode[1]) == 0 && ccode[1] >= 0x41 && ccode[1] <= 0x5A))
                return false;
 
        /*