diff options
author | Zhang Shurong <zhang_shurong@foxmail.com> | 2023-07-15 15:42:57 +0200 |
---|---|---|
committer | Kalle Valo <kvalo@kernel.org> | 2023-07-25 16:44:18 +0200 |
commit | 59b4cc439f184c5eaa34161ec67af1e16ffabed4 (patch) | |
tree | 5510b09f73bad37597bf5ff370494dd8cffdb091 /drivers | |
parent | wifi: rtw88: simplify vif iterators (diff) | |
download | linux-59b4cc439f184c5eaa34161ec67af1e16ffabed4.tar.xz linux-59b4cc439f184c5eaa34161ec67af1e16ffabed4.zip |
wifi: rtw89: debug: Fix error handling in rtw89_debug_priv_btc_manual_set()
If there is a failure during kstrtobool_from_user()
rtw89_debug_priv_btc_manual_set should return a negative error code
instead of returning the count directly.
Fix this bug by returning an error code instead of a count after
a failed call of the function "kstrtobool_from_user". Moreover
I omitted the label "out" with this source code correction.
Fixes: e3ec7017f6a2 ("rtw89: add Realtek 802.11ax driver")
Signed-off-by: Zhang Shurong <zhang_shurong@foxmail.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/tencent_1C09B99BD7DA9CAD18B00C8F0F050F540607@qq.com
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/realtek/rtw89/debug.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/wireless/realtek/rtw89/debug.c b/drivers/net/wireless/realtek/rtw89/debug.c index a4bbac916e22..ce5a9ac08145 100644 --- a/drivers/net/wireless/realtek/rtw89/debug.c +++ b/drivers/net/wireless/realtek/rtw89/debug.c @@ -3193,12 +3193,14 @@ static ssize_t rtw89_debug_priv_btc_manual_set(struct file *filp, struct rtw89_dev *rtwdev = debugfs_priv->rtwdev; struct rtw89_btc *btc = &rtwdev->btc; bool btc_manual; + int ret; - if (kstrtobool_from_user(user_buf, count, &btc_manual)) - goto out; + ret = kstrtobool_from_user(user_buf, count, &btc_manual); + if (ret) + return ret; btc->ctrl.manual = btc_manual; -out: + return count; } |