From patchwork Sat Apr 22 10:04:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhang Shurong X-Patchwork-Id: 13220938 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3622DC6FD18 for ; Sat, 22 Apr 2023 10:07:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229720AbjDVKHK (ORCPT ); Sat, 22 Apr 2023 06:07:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229669AbjDVKHJ (ORCPT ); Sat, 22 Apr 2023 06:07:09 -0400 Received: from out203-205-221-249.mail.qq.com (out203-205-221-249.mail.qq.com [203.205.221.249]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41D721BCD; Sat, 22 Apr 2023 03:07:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1682158025; bh=SnfImROfHHS8oLIFhAcHzEgotoQ5IZ5awfUwJVXBhm0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=WmKYODdefrAXogqZ2E1TDxf8x+7ivr587ESi2J6qIzBaW2XNpZy0ADm1lpX2t3cYK Q3Q7WqNebdfuDc+I6z9wNN1xRcYuO+dAR37eDX5j4QKpmJNvzWrlzYbImfsOIoH5aE Fei4Fl9EUx6BnDHNdwHnRP5Sv90sh7HzDbACrx3k= Received: from localhost.localdomain ([49.7.199.72]) by newxmesmtplogicsvrszb6-0.qq.com (NewEsmtp) with SMTP id 1402C0F4; Sat, 22 Apr 2023 18:05:00 +0800 X-QQ-mid: xmsm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d0iyCdHBEUFr9Uki+5 M0AfDuMxyOTTgV26MX2Z2v3AZIGoQPGvkegiKWrUNcgiFYhvf80L532EeSUL2arWCWE+0IgstU3C kGebNQDQTIN+c6Z/vk+tDVDVAhJQ== From: Zhang Shurong To: tony0620emma@gmail.com Cc: kvalo@kernel.org, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Zhang Shurong Subject: [PATCH 09/10] wifi: rtw88: fix incorrect error codes in rtw_debugfs_set_coex_enable Date: Sat, 22 Apr 2023 18:04:53 +0800 X-OQ-MSGID: <4948f7c2aca708649f1acccbce71dae00e18b2a7.1682156784.git.zhang_shurong@foxmail.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org If there is a failure during copy_from_user, rtw_debugfs_set_coex_enable should return negative error code instead of a positive value count. Fix this bug by returning correct error code. Signed-off-by: Zhang Shurong --- drivers/net/wireless/realtek/rtw88/debug.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/realtek/rtw88/debug.c b/drivers/net/wireless/realtek/rtw88/debug.c index aef43f3ca364..f9bcb44b42ac 100644 --- a/drivers/net/wireless/realtek/rtw88/debug.c +++ b/drivers/net/wireless/realtek/rtw88/debug.c @@ -883,7 +883,9 @@ static ssize_t rtw_debugfs_set_coex_enable(struct file *filp, bool enable; int ret; - rtw_debugfs_copy_from_user(tmp, sizeof(tmp), buffer, count, 1); + ret = rtw_debugfs_copy_from_user(tmp, sizeof(tmp), buffer, count, 1); + if (ret < 0) + return ret; ret = kstrtobool(tmp, &enable); if (ret) {