Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 68eed6ee authored by Dan Carpenter's avatar Dan Carpenter Committed by John W. Linville
Browse files

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.

Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent b90af3b8
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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;

	/*