]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
rtw88: Fix an error code in rtw_debugfs_set_rsvd_page()
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 15 Mar 2021 09:23:37 +0000 (12:23 +0300)
committerKelsey Skunberg <kelsey.skunberg@canonical.com>
Mon, 24 May 2021 23:46:36 +0000 (17:46 -0600)
BugLink: https://bugs.launchpad.net/bugs/1929455
[ Upstream commit c9eaee0c2ec6b1002044fb698cdfb5d9ef4ed28c ]

The sscanf() function returns the number of matches (0 or 1 in this
case).  It doesn't return error codes.  We should return -EINVAL if the
string is invalid

Fixes: c376c1fc87b7 ("rtw88: add h2c command in debugfs")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/YE8nmatMDBDDWkjq@mwanda
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
drivers/net/wireless/realtek/rtw88/debug.c

index 19fc2d8bf3e9318b7719b19ad3811f4b44b2d869..f872fcd1569981c3e84abd2c4d54c5f067b4a94a 100644 (file)
@@ -270,7 +270,7 @@ static ssize_t rtw_debugfs_set_rsvd_page(struct file *filp,
 
        if (num != 2) {
                rtw_warn(rtwdev, "invalid arguments\n");
-               return num;
+               return -EINVAL;
        }
 
        debugfs_priv->rsvd_page.page_offset = offset;