Skip to content

Commit fb4bccd

Browse files
greearbjmberg-intel
authored andcommitted
mac80211: fix ht_capa printout in debugfs
Don't use sizeof(pointer) when calculating scnprintf offset. Fixes: 01f84f0 ("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>
1 parent a5199b5 commit fb4bccd

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

net/mac80211/debugfs_sta.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ static ssize_t sta_ht_capa_read(struct file *file, char __user *userbuf,
441441
#define PRINT_HT_CAP(_cond, _str) \
442442
do { \
443443
if (_cond) \
444-
p += scnprintf(p, sizeof(buf)+buf-p, "\t" _str "\n"); \
444+
p += scnprintf(p, bufsz + buf - p, "\t" _str "\n"); \
445445
} while (0)
446446
char *buf, *p;
447447
int i;

0 commit comments

Comments
 (0)