Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp5782258rwp; Mon, 17 Jul 2023 09:19:19 -0700 (PDT) X-Google-Smtp-Source: APBJJlFEr66gqd7DlsUgURPXkZVhNbe7Aq5LOJOY/hHfGE0IikZqs0wiktIXfIRJyAqvK09nu1Rq X-Received: by 2002:a05:6402:551:b0:51d:d5f2:121c with SMTP id i17-20020a056402055100b0051dd5f2121cmr299646edx.5.1689610758773; Mon, 17 Jul 2023 09:19:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689610758; cv=none; d=google.com; s=arc-20160816; b=GaGhuyN2O0Od48xb10rL6QZyI9yY0gUbtHM4K+eMWZ8hdPg83s5OhPHELepK7p1Z54 thOXVL5bISL959EXrGaWQeETnFtBjFE+dkSMwxrKcJykJ2fetEdGu0sg1qQwSIpM/IiN Xe9SMmogcTYke+VQlzCMULCUbBxB2Jz0ZnXIv+cKUr+RijCgnlXq9tzfpcHKngAJ0lhT Pl9LrrJD1tt3yDxLYxPUYe2wtZz0WctplSrKD9NuGeZP1GMNafWnHGzA0g7q3t6D6b/8 U8JtfNzWE+wx2SEFcdQsEDxhmDy8Uxt4nI1W7PiKwj4L6gkaFsD7+de7WA5yHdTvxR4v D0XQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=/Ubjqz+647wg37y8LsyDkdlWOz7DaYqCOqREBCpdNjY=; fh=5RqpG8t3ywoqcWEknfRtuFBT347tBncevxIfHyLky0U=; b=K74MtdmEqFZxPqTmV3QuX+oE88lgwd5HSGrMrTp5BFeyQoWEAtPEEibklISeT/FXsO Wj7cYeRsRHZDImrxPkqLlfSKSbgct/FnIjkPmHdm/NhSiXQOG/Zgebgk4CRvBSjJA/+9 vDOJxtpjSomUohHB3l+K7F7sVAWM8P/enifvK59Vxq0FydRaRL9nkSqVa2SQryhBHID9 3sf58fREQU/KwMIk5WaTdHyfcYyRHYFT6kiOTlcz15DpO0/F1Vzw+lBl4MjaeaPYBb/c 5XFWE6cWflq7/fkghfc4PbuBpmU2alcrPEWKpwEWLtpotxqiZJjnc51yGvrLZD15uVi4 Injw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=kyevH8Ls; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m17-20020aa7d351000000b0052061adfbb4si7145222edr.80.2023.07.17.09.19.00; Mon, 17 Jul 2023 09:19:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=kyevH8Ls; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231255AbjGQQD4 (ORCPT + 58 others); Mon, 17 Jul 2023 12:03:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229564AbjGQQDz (ORCPT ); Mon, 17 Jul 2023 12:03:55 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1FE31E3; Mon, 17 Jul 2023 09:03:54 -0700 (PDT) Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36H6x9v0013727; Mon, 17 Jul 2023 16:03:43 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=qcppdkim1; bh=/Ubjqz+647wg37y8LsyDkdlWOz7DaYqCOqREBCpdNjY=; b=kyevH8LsfqmT18hzfI7MiiXNSOO20l0u8c+Xd6HHWFhgJEY4XA/fLxqnn3T41WU8A3CU gFUl3u9gATEaQyJxtYrmZTPaYvZ6OCutdl5F5NK2OMhEdzuGYCz5uG7fK+q0zArEnd5w NJTGUAfXECSH4mUDfnE4Z+60TzxqB2AOrIr4Dx7bYcj3xuwDAC5uIF+x4PCKlqzVe0us Pg2UztBfV4fW/qVg8M6sB17QvcQC+54fzn0sVj9c58mWDnyyeuQcJofOzHk1gDQs+oJe o/Icvo3OtL92tkUs4Tf1GpNmsWIF+htUvGLnM70vodhhlZeWisAsgSZs1rSsVYG/kQTA MQ== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3run0auy91-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Jul 2023 16:03:42 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 36HG3fhY009161 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Jul 2023 16:03:41 GMT Received: from [10.48.240.159] (10.49.16.6) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Mon, 17 Jul 2023 09:03:41 -0700 Message-ID: Date: Mon, 17 Jul 2023 09:03:40 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v3] wifi: rtw89: debug: fix error code in Content-Language: en-US To: Zhang Shurong , , , CC: , , References: From: Jeff Johnson In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.49.16.6] X-ClientProxiedBy: nalasex01b.na.qualcomm.com (10.47.209.197) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: 4gNcLI_OGMFEBBiGyhsrOYSdhs-CKzc4 X-Proofpoint-ORIG-GUID: 4gNcLI_OGMFEBBiGyhsrOYSdhs-CKzc4 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-17_12,2023-07-13_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 adultscore=0 mlxlogscore=802 bulkscore=0 priorityscore=1501 mlxscore=0 suspectscore=0 impostorscore=0 lowpriorityscore=0 clxscore=1011 spamscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2307170147 X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On 7/15/2023 5:51 AM, Zhang Shurong wrote: > 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. nit: s/driectly/directly/ > > Fix this bug with the following changes: > - Return an error code instead of a count after a failed call > of the function "kstrtobool_from_user". > - Omit the label "out" with this source code correction. > > 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 > Changes in v3: > - Improved change description > > 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; > } >