Skip to contentSkip to conversation

mac80211: fix ht_capa printout in debugfs.

PATCH New [email protected] 1 participant 1 message Apr 6, 2022 mac80211

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mac80211: fix ht_capa printout in debugfs.

From: Ben Greear <[email protected]>

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

Fixes mac80211: debugfs: calculate free buffer size correctly (eb3d6175e4a9)
---
 net/mac80211/debugfs_sta.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/mac80211/debugfs_sta.c +1 -1
index 19195d63ae5c..db852f8c5feb 100644
@@ -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;
Signature · 1 line
2.20.1