From: Zhang Shurong <zhang_shurong@foxmail.com>
To: pkshih@realtek.com
Cc: kvalo@kernel.org, linux-wireless@vger.kernel.org,
linux-kernel@vger.kernel.org,
Zhang Shurong <zhang_shurong@foxmail.com>
Subject: [PATCH v4] wifi: rtw89: debug: fix error code in rtw89_debug_priv_send_h2c_set()
Date: Thu, 6 Jul 2023 10:45:00 +0800 [thread overview]
Message-ID: <tencent_AD09A61BC4DA92AD1EB0790F5C850E544D07@qq.com> (raw)
If there is a failure during rtw89_fw_h2c_raw() rtw89_debug_priv_send_h2c
should return negative error code instead of a positive value count.
Fix this bug by returning correct error code.
Fixes: e3ec7017f6a2 ("rtw89: add Realtek 802.11ax driver")
Signed-off-by: Zhang Shurong <zhang_shurong@foxmail.com>
---
Changes in v2:
- fixed compile error
Changes in v3:
- Corrected the annotation of this patch
- Used variable ret instead of err
Changes in v4:
- Corrected thr format of this patch
---
drivers/net/wireless/realtek/rtw89/debug.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtw89/debug.c b/drivers/net/wireless/realtek/rtw89/debug.c
index 1db2d59d33ff..a4bbac916e22 100644
--- a/drivers/net/wireless/realtek/rtw89/debug.c
+++ b/drivers/net/wireless/realtek/rtw89/debug.c
@@ -3026,17 +3026,18 @@ static ssize_t rtw89_debug_priv_send_h2c_set(struct file *filp,
struct rtw89_debugfs_priv *debugfs_priv = filp->private_data;
struct rtw89_dev *rtwdev = debugfs_priv->rtwdev;
u8 *h2c;
+ int ret;
u16 h2c_len = count / 2;
h2c = rtw89_hex2bin_user(rtwdev, user_buf, count);
if (IS_ERR(h2c))
return -EFAULT;
- rtw89_fw_h2c_raw(rtwdev, h2c, h2c_len);
+ ret = rtw89_fw_h2c_raw(rtwdev, h2c, h2c_len);
kfree(h2c);
- return count;
+ return ret ? ret : count;
}
static int
--
2.30.2
next reply other threads:[~2023-07-06 2:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-06 2:45 Zhang Shurong [this message]
2023-07-06 2:50 ` [PATCH v4] wifi: rtw89: debug: fix error code in rtw89_debug_priv_send_h2c_set() Ping-Ke Shih
2023-07-13 0:53 ` Jakub Kicinski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tencent_AD09A61BC4DA92AD1EB0790F5C850E544D07@qq.com \
--to=zhang_shurong@foxmail.com \
--cc=kvalo@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=pkshih@realtek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.