Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Ben Greear and committed by
Johannes Berg
fb4bccd8 a5199b56

+1 -1
+1 -1
net/mac80211/debugfs_sta.c
··· 441 441 #define PRINT_HT_CAP(_cond, _str) \ 442 442 do { \ 443 443 if (_cond) \ 444 - p += scnprintf(p, sizeof(buf)+buf-p, "\t" _str "\n"); \ 444 + p += scnprintf(p, bufsz + buf - p, "\t" _str "\n"); \ 445 445 } while (0) 446 446 char *buf, *p; 447 447 int i;