All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] brcmsmac: fix brcms_c_country_valid()
@ 2013-02-12 12:23 ` Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2013-02-12 12:23 UTC (permalink / raw)
  To: Brett Rudley
  Cc: Arend van Spriel, Franky (Zhenhui) Lin, Hante Meuleman,
	John W. Linville, Seth Forshee, Pieter-Paul Giesberts,
	linux-wireless, brcm80211-dev-list, kernel-janitors

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>
---
This is a static checker fix.  I don't know what ->leddc_on_time is in
practice.

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [patch] brcmsmac: fix brcms_c_country_valid()
@ 2013-02-12 12:23 ` Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2013-02-12 12:23 UTC (permalink / raw)
  To: Brett Rudley
  Cc: Arend van Spriel, Franky (Zhenhui) Lin, Hante Meuleman,
	John W. Linville, Seth Forshee, Pieter-Paul Giesberts,
	linux-wireless, brcm80211-dev-list, kernel-janitors

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>
---
This is a static checker fix.  I don't know what ->leddc_on_time is in
practice.

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-02-12 12:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-12 12:23 [patch] brcmsmac: fix brcms_c_country_valid() Dan Carpenter
2013-02-12 12:23 ` Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.