From: Ben Greear <greearb@xxxxxxxxxxxxxxx> Don't use sizeof(pointer) when calculating scnprintf offset. Fixes: mac80211: debugfs: calculate free buffer size correctly (eb3d6175e4a9) Signed-off-by: Ben Greear <greearb@xxxxxxxxxxxxxxx> --- net/mac80211/debugfs_sta.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/mac80211/debugfs_sta.c b/net/mac80211/debugfs_sta.c index 19195d63ae5c..db852f8c5feb 100644 --- a/net/mac80211/debugfs_sta.c +++ b/net/mac80211/debugfs_sta.c @@ -584,7 +584,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; -- 2.20.1