Skip to contentSkip to conversation

cfg80211 debugfs: fix return type in ht40allow_map_read()

PATCH New Dan Carpenter 1 participant 1 message Aug 4, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cfg80211 debugfs: fix return type in ht40allow_map_read()

The return type is supposed to be ssize_t, which is signed long, but "r" was declared as unsigned int. This means that on 64 bit systems we return positive values instead of negative error codes.

Fixes 80a3511d70e8 ("cfg80211: add debugfs HT40 allow map")
---
 net/wireless/debugfs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
net/wireless/debugfs.c +2 -1
index aab43469a2f0..0878b162890a 100644
@@ -65,9 +65,10 @@ static ssize_t ht40allow_map_read(struct file *file,
 {
 	struct wiphy *wiphy = file->private_data;
 	char *buf;
-	unsigned int offset = 0, buf_size = PAGE_SIZE, i, r;
+	unsigned int offset = 0, buf_size = PAGE_SIZE, i;
 	enum nl80211_band band;
 	struct ieee80211_supported_band *sband;
+	ssize_t r;
 
 	buf = kzalloc(buf_size, GFP_KERNEL);
 	if (!buf)
Signature · 1 line
2.35.1