mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 23:27:06 +00:00
wifi: rtw89: debug: fix error code in rtw89_debug_priv_send_h2c_set()
[ Upstream commit4f4626cd04
] 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:e3ec7017f6
("rtw89: add Realtek 802.11ax driver") Signed-off-by: Zhang Shurong <zhang_shurong@foxmail.com> Acked-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://lore.kernel.org/r/tencent_AD09A61BC4DA92AD1EB0790F5C850E544D07@qq.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
3d1dc71b8f
commit
0aec8dab2b
1 changed files with 3 additions and 2 deletions
|
@ -2130,17 +2130,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
|
||||
|
|
Loading…
Reference in a new issue