From patchwork Sat Jul 15 06:44:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhang Shurong X-Patchwork-Id: 13314397 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 3F683EB64DC for ; Sat, 15 Jul 2023 06:51:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229872AbjGOGve (ORCPT ); Sat, 15 Jul 2023 02:51:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229483AbjGOGvd (ORCPT ); Sat, 15 Jul 2023 02:51:33 -0400 Received: from out203-205-221-239.mail.qq.com (out203-205-221-239.mail.qq.com [203.205.221.239]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91FE23599; Fri, 14 Jul 2023 23:51:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1689403880; bh=NERu/KtVTq3aiG51hr0iINkM+uTg2JQTX/C5jpABD4s=; h=From:To:Cc:Subject:Date; b=MKeuIyY4KWXwpz9KEL+skFtpEZLTM6Ex9evYkT7Xxk2i8ulUwqgvaRUFpjUgy773Q ab70YvDnoqEIwRkU/c6jrRfA0jOijlDKpSD+kSdR0e14+VHmy1+5Vfaf0DESzwxatr ZxO//BLXPyJ4nveiQODt8xXdzKDseAiMt0OScAbg= Received: from KernelDevBox.byted.org ([180.184.51.134]) by newxmesmtplogicsvrsza7-0.qq.com (NewEsmtp) with SMTP id B3B81259; Sat, 15 Jul 2023 14:44:59 +0800 X-QQ-mid: xmsmtpt1689403499tmzqxrafn Message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eAVDbp3OJHYyFg= From: Zhang Shurong To: pkshih@realtek.com, Markus.Elfring@web.de, kuba@kernel.org Cc: kvalo@kernel.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, Zhang Shurong Subject: [PATCH v2] wifi: rtw89: debug: fix error code in rtw89_debug_priv_btc_manual_set Date: Sat, 15 Jul 2023 14:44:57 +0800 X-OQ-MSGID: <20230715064457.971310-1-zhang_shurong@foxmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org If there is a failure during kstrtobool_from_user() rtw89_debug_priv_btc_manual_set should return negative error code instead of returning the count driectly. Fix this bug by returning the correct error code. Fixes: e3ec7017f6a2 ("rtw89: add Realtek 802.11ax driver") Signed-off-by: Zhang Shurong --- Changes in v2: - Corrected the format of this patch - Used variable ret instead of goto out drivers/net/wireless/realtek/rtw89/debug.c | 8 +++++--- 1 file 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; }