]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
wifi: cfg80211: debugfs: fix return type in ht40allow_map_read()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 4 Aug 2022 07:03:21 +0000 (10:03 +0300)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 23 Nov 2022 14:10:48 +0000 (15:10 +0100)
BugLink: https://bugs.launchpad.net/bugs/1991840
[ Upstream commit d776763f48084926b5d9e25507a3ddb7c9243d5e ]

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")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/YutvOQeJm0UjLhwU@kili
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
net/wireless/debugfs.c

index aab43469a2f0417096e2a5e7689c88236f88943e..0878b162890af7c57073991468415a87dc9edc16 100644 (file)
@@ -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)