diff options
author | Ben Greear <greearb@candelatech.com> | 2022-04-06 19:56:59 +0200 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2022-04-11 11:57:27 +0200 |
commit | fb4bccd863ccccd36ad000601856609e259a1859 (patch) | |
tree | 6982cfbca73f3e6dbafd87e0c8b426aaa9116252 /net/mac80211/debugfs_sta.c | |
parent | cfg80211: hold bss_lock while updating nontrans_list (diff) | |
download | linux-fb4bccd863ccccd36ad000601856609e259a1859.tar.xz linux-fb4bccd863ccccd36ad000601856609e259a1859.zip |
mac80211: fix ht_capa printout in debugfs
Don't use sizeof(pointer) when calculating scnprintf offset.
Fixes: 01f84f0ed3b4 ("mac80211: reduce stack usage in debugfs")
Signed-off-by: Ben Greear <greearb@candelatech.com>
Link: https://lore.kernel.org/r/20220406175659.20611-1-greearb@candelatech.com
[correct the Fixes tag]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/debugfs_sta.c')
-rw-r--r-- | net/mac80211/debugfs_sta.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/mac80211/debugfs_sta.c b/net/mac80211/debugfs_sta.c index 9479f2787ea7..88d9cc945a21 100644 --- a/net/mac80211/debugfs_sta.c +++ b/net/mac80211/debugfs_sta.c @@ -441,7 +441,7 @@ static ssize_t sta_ht_capa_read(struct file *file, char __user *userbuf, #define PRINT_HT_CAP(_cond, _str) \ do { \ if (_cond) \ - p += scnprintf(p, sizeof(buf)+buf-p, "\t" _str "\n"); \ + p += scnprintf(p, bufsz + buf - p, "\t" _str "\n"); \ } while (0) char *buf, *p; int i; |