linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] rtw88: Fix an error code in rtw_debugfs_set_rsvd_page()
@ 2021-03-15  9:23 Dan Carpenter
  2021-04-11  9:29 ` Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2021-03-15  9:23 UTC (permalink / raw)
  To: Yan-Hsuan Chuang
  Cc: Kalle Valo, Tzu-En Huang, linux-wireless, kernel-janitors

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>
---
v2: Style change.  Keep "num" variable.

 drivers/net/wireless/realtek/rtw88/debug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/realtek/rtw88/debug.c b/drivers/net/wireless/realtek/rtw88/debug.c
index 948cb79050ea..e7d51ac9b689 100644
--- a/drivers/net/wireless/realtek/rtw88/debug.c
+++ b/drivers/net/wireless/realtek/rtw88/debug.c
@@ -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;
-- 
2.30.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] rtw88: Fix an error code in rtw_debugfs_set_rsvd_page()
  2021-03-15  9:23 [PATCH v2] rtw88: Fix an error code in rtw_debugfs_set_rsvd_page() Dan Carpenter
@ 2021-04-11  9:29 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2021-04-11  9:29 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Yan-Hsuan Chuang, Tzu-En Huang, linux-wireless, kernel-janitors

Dan Carpenter <dan.carpenter@oracle.com> wrote:

> 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>

Patch applied to wireless-drivers-next.git, thanks.

c9eaee0c2ec6 rtw88: Fix an error code in rtw_debugfs_set_rsvd_page()

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/YE8nmatMDBDDWkjq@mwanda/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-04-11  9:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-15  9:23 [PATCH v2] rtw88: Fix an error code in rtw_debugfs_set_rsvd_page() Dan Carpenter
2021-04-11  9:29 ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).