aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Norris <[email protected]>2014-12-10 01:39:18 -0800
committerJohn W. Linville <[email protected]>2014-12-15 13:46:20 -0500
commit1d240d370290445e08a35917700776db60ffe831 (patch)
treea1325823a3e5b0e4a999260d4cf27356a98168b8
parent8670d4d603794e643601707e9222df49a2430840 (diff)
brcmsmac: don't leak kernel memory via printk()
Debug code prints the fifo name via custom dev_warn() wrappers. The fifo_names array is only non-zero when debugging is manually enabled, which is all well and good. However, it's *not* good that this array uses zero-length arrays in the non-debug case, and so it doesn't actually have any memory allocated to it. This means that as far as we know, fifo_names[i] actually points to garbage memory. I've seen this in my log: [ 4601.205511] brcmsmac bcma0:1: wl0: brcms_c_d11hdrs_mac80211: �GeL txop exceeded phylen 137/256 dur 1602/1504 So let's give this array space enough to fill it with a NULL byte. Signed-off-by: Brian Norris <[email protected]> Cc: Brett Rudley <[email protected]> Cc: Arend van Spriel <[email protected]> Cc: "Franky (Zhenhui) Lin" <[email protected]> Cc: Hante Meuleman <[email protected]> Cc: "John W. Linville" <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Acked-by: Arend van Spriel <[email protected]> Signed-off-by: John W. Linville <[email protected]>
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/main.c b/drivers/net/wireless/brcm80211/brcmsmac/main.c
index a104d7ac3796..eb8584a9c49a 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/main.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c
@@ -316,7 +316,7 @@ static const u16 xmtfifo_sz[][NFIFO] = {
static const char * const fifo_names[] = {
"AC_BK", "AC_BE", "AC_VI", "AC_VO", "BCMC", "ATIM" };
#else
-static const char fifo_names[6][0];
+static const char fifo_names[6][1];
#endif
#ifdef DEBUG