OSDN Git Service

mac80211: reduce stack usage in sta_ht_capa_read()
authorPavel Roskin <proski@gnu.org>
Sun, 31 Jan 2010 00:55:09 +0000 (19:55 -0500)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 1 Feb 2010 20:40:07 +0000 (15:40 -0500)
The maximal size of the "ht_capa" file is 430 bytes.  In most cases,
it's much shorter.  Use a 512 byte long buffer.  1024 bytes is too much
and causes a warning with CONFIG_FRAME_WARN=1024.

Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/debugfs_sta.c

index 0d4a759..84865e7 100644 (file)
@@ -165,7 +165,7 @@ static ssize_t sta_ht_capa_read(struct file *file, char __user *userbuf,
        if (_cond) \
                        p += scnprintf(p, sizeof(buf)+buf-p, "\t" _str "\n"); \
        } while (0)
-       char buf[1024], *p = buf;
+       char buf[512], *p = buf;
        int i;
        struct sta_info *sta = file->private_data;
        struct ieee80211_sta_ht_cap *htc = &sta->sta.ht_cap;