Skip to contentSkip to conversation

brcmsmac: fix brcms_c_country_valid()

PATCH New Dan Carpenter 1 participant 1 message Feb 12, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 brcmsmac: fix brcms_c_country_valid()

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.

---
This is a static checker fix. I don't know what ->leddc_on_time is in practice.

drivers/net/wireless/brcm80211/brcmsmac/channel.c +1 -2
index cdb62b8..10ee314 100644
@@ -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;
 
 	/*