diff mbox series

mac80211: fix ht_capa printout in debugfs.

Message ID 20220406175659.20611-1-greearb@candelatech.com
State New
Headers show
Series mac80211: fix ht_capa printout in debugfs. | expand

Commit Message

Ben Greear April 6, 2022, 5:56 p.m. UTC
From: Ben Greear <greearb@candelatech.com>

Don't use sizeof(pointer) when calculating scnprintf offset.

Fixes: mac80211: debugfs: calculate free buffer size correctly (eb3d6175e4a9)
Signed-off-by: Ben Greear <greearb@candelatech.com>
---
 net/mac80211/debugfs_sta.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

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;