Skip to content

Commit 4f4626c

Browse files
ZhangShurongkuba-moo
authored andcommitted
wifi: rtw89: debug: fix error code in rtw89_debug_priv_send_h2c_set()
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: e3ec701 ("rtw89: add Realtek 802.11ax driver") Signed-off-by: Zhang Shurong <[email protected]> Acked-by: Ping-Ke Shih <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent aa84667 commit 4f4626c

File tree

1 file changed

+3
-2
lines changed
  • drivers/net/wireless/realtek/rtw89

1 file changed

+3
-2
lines changed

drivers/net/wireless/realtek/rtw89/debug.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3026,17 +3026,18 @@ static ssize_t rtw89_debug_priv_send_h2c_set(struct file *filp,
30263026
struct rtw89_debugfs_priv *debugfs_priv = filp->private_data;
30273027
struct rtw89_dev *rtwdev = debugfs_priv->rtwdev;
30283028
u8 *h2c;
3029+
int ret;
30293030
u16 h2c_len = count / 2;
30303031

30313032
h2c = rtw89_hex2bin_user(rtwdev, user_buf, count);
30323033
if (IS_ERR(h2c))
30333034
return -EFAULT;
30343035

3035-
rtw89_fw_h2c_raw(rtwdev, h2c, h2c_len);
3036+
ret = rtw89_fw_h2c_raw(rtwdev, h2c, h2c_len);
30363037

30373038
kfree(h2c);
30383039

3039-
return count;
3040+
return ret ? ret : count;
30403041
}
30413042

30423043
static int

0 commit comments

Comments
 (0)