wifi: rtw88: fix incorrect error codes in rtw_debugfs_set_*
authorZhang Shurong <zhang_shurong@foxmail.com>
Wed, 26 Apr 2023 17:02:21 +0000 (01:02 +0800)
committerKalle Valo <kvalo@kernel.org>
Fri, 5 May 2023 07:38:08 +0000 (10:38 +0300)
commit77005533777267736fca64fa376b8a835cb8806b
treecc4f3c6c8076c2c741be7bde96ab12c556255320
parent225622256b1b7156624e281e1c0251c292ea24cd
wifi: rtw88: fix incorrect error codes in rtw_debugfs_set_*

If there is a failure during copy_from_user or user-provided data
buffer is invalid, rtw_debugfs_set_* should return negative
error code instead of a positive value count.

Fix this bug by returning correct error code.

Signed-off-by: Zhang Shurong <zhang_shurong@foxmail.com>
Reviewed-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/tencent_53140CC2A3468101955F02EB66AA96780B05@qq.com
drivers/net/wireless/realtek/rtw88/debug.c