summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/realtek/rtw88/debug.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2021-03-15 12:23:37 +0300
committerKalle Valo <kvalo@codeaurora.org>2021-04-11 12:29:06 +0300
commitc9eaee0c2ec6b1002044fb698cdfb5d9ef4ed28c (patch)
treec147bd15c464a55f601f440e3f49ae78df2516fa /drivers/net/wireless/realtek/rtw88/debug.c
parent4517f811258d81a4666a7d0228a774dfbdb1e4fd (diff)
downloadlinux-c9eaee0c2ec6b1002044fb698cdfb5d9ef4ed28c.tar.xz
rtw88: Fix an error code in rtw_debugfs_set_rsvd_page()
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
Diffstat (limited to 'drivers/net/wireless/realtek/rtw88/debug.c')
-rw-r--r--drivers/net/wireless/realtek/rtw88/debug.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/wireless/realtek/rtw88/debug.c b/drivers/net/wireless/realtek/rtw88/debug.c
index 4539b673f6fd..5c44fa87ed2e 100644
--- a/drivers/net/wireless/realtek/rtw88/debug.c
+++ b/drivers/net/wireless/realtek/rtw88/debug.c
@@ -271,7 +271,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;