Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp34000449rwd; Sun, 9 Jul 2023 03:03:31 -0700 (PDT) X-Google-Smtp-Source: APBJJlG5VoKG9p1mCtBhDN4KefLVEcN4YV8olBr+hbEIFYSUHRhwQi0hjvXFPZZ0ha4Nqscaq02W X-Received: by 2002:a05:6a00:cc6:b0:680:98c:c593 with SMTP id b6-20020a056a000cc600b00680098cc593mr13766011pfv.7.1688897010712; Sun, 09 Jul 2023 03:03:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688897010; cv=none; d=google.com; s=arc-20160816; b=c2D+0Gp6zanTG6SLfJXQy5wVuctZIjMr1zL2Lmhb1ou+xVQviAGcrEG6DKRnxp3OvT BxD+y4v85IB3kyZt8kVay+UfOCKBZJ3KuB5RFMIRfKTPgVJPY8S4KoNeFqiHsMyPF74h 4JJioVuacfkdHgv349Ow7FnifO9IIlvGIv8B70wJ/NDEgN0UKd/a1IPUXp9Tn9Fpjser 3lqTQFTg1agN0mt0TaY87pQheT/MjL39nuJPJWLaHL6K8fsXQWIeatRQd6OzeOgOIa4P qDCefTKIQKFBsmfPMnDmEwY2QYJvC8iB9aYR1xWwE6ykxQZbMJud79Xp9BnUt1FazXOd aPcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version:date :subject:cc:to:from:message-id:dkim-signature; bh=Ok2UwAr6nX11lqE2tuCWc4B2WooiEHa6YY7cWJtYm5c=; fh=jXRDG/tsS6a1omt5jqVweCt4XHeaMWU6aDaXH3qVXjI=; b=Dw5jiAe3kdM9nOdhQvuvzUcdwh2btYqsmd+6JB3v820XSbH7E0bWhkwewe4uc85/i8 yREOpaEuM73/PvZxVe3EF6rX9ABOVR/NjY8TTxG/2UuKQ5QyqQ6plpBC+Ptr10PJ5owl 71ywSmROGvV5BlFG6PLsFvZlA1+8Rw3Cnuk42vdReCtoqKqLR0xlT4SuBT0LOuHcIb0c UNyhTbufQTAJPX3pkIz+g6OzjRPo2eh7BdYWFoEZopXaR9lBgp0wR9A/FtiXdTwIITbj sBjlLyXqNg+5fvrt7NHD6Jgv92QrEKNJRV2P3j04CTvnfILcBmJecayvzrOmp0E9+T8o 3mKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@foxmail.com header.s=s201512 header.b=cQd5gBrx; 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=foxmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w190-20020a6362c7000000b00553a56f7b34si2433640pgb.788.2023.07.09.03.03.17; Sun, 09 Jul 2023 03:03:30 -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=@foxmail.com header.s=s201512 header.b=cQd5gBrx; 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=foxmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230226AbjGIJ7Q (ORCPT + 61 others); Sun, 9 Jul 2023 05:59:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229534AbjGIJ7P (ORCPT ); Sun, 9 Jul 2023 05:59:15 -0400 Received: from out162-62-57-49.mail.qq.com (out162-62-57-49.mail.qq.com [162.62.57.49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F525129; Sun, 9 Jul 2023 02:59:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1688896749; bh=Ok2UwAr6nX11lqE2tuCWc4B2WooiEHa6YY7cWJtYm5c=; h=From:To:Cc:Subject:Date; b=cQd5gBrxZo7fGbwbn8T4madSXQbDYcfpj+xEqi3vrAmdhK5wJYlOLAvSfIquDdCdw ZZhKXSDF6rQRqCb1SOknbbX4PgEWeaIgf8C+yEaDrhE3VADIfjJwp9TMCj1+ZIa0Br OvzgCboAkku91IR0wGAxDMXWUIfNdNuTVGyCDwfo= Received: from KernelDevBox.byted.org ([180.184.51.70]) by newxmesmtplogicsvrszb6-0.qq.com (NewEsmtp) with SMTP id EC6B723B; Sun, 09 Jul 2023 17:59:06 +0800 X-QQ-mid: xmsmtpt1688896746txvus3ima Message-ID: X-QQ-XMAILINFO: MiPTq5wGoKOmUZayXFMbPdKq3GyQoIS6wb3ksGfePb/XTg/wF4e/VTzejTczIZ qZsjbOgAXkF60VdxvoqdJUSkRMBNao2VOk2M7hYKGxm9qNyrIy6v55ZiO5LW6nOAfBgqGIURQv83 2af/VAryqaPxSr/+/KYfbqX1l6wI0mVhqZMHHGO+lcYZwhKVr9kUmuFJ8dXGKFvZlBVnDdDzcfFc zsjXQ1IBBG2Pz1sNAvsNRmWOqSBLZ/9y4ZIphKUsG3pZfmwsCKrkWKubuMqmIVE04RRKGzUz5nTY L/iFJreE5qb3X8NbBc6pnw2CEA/0PRg15tyJ4WBkhl8zMQ8c2pjbPEoIE44fGJRcFc4uvRYdofea wLkJ+Es94Uf0zmrjKHv1l8PjOsulU+IXUcEAatF3HPa3DpJdyJ4koehe3xD72KLnhDqTtgz6g9PW 3ZO3w4NlU20UQ8d4kdKEA1NvUa8bQFD0lg51ZylVD2PagOHml4gFoxq+dyrMydofXo4blu09XZt3 HsQu5Q0vW1tvk4PVIbvHPmq4DKWn8y/l+CaCzv7tJG/MgN9DBgNxpyQepNYALjQc1nHbJGnoulSY IpqBlkbY82Jnhy+aPViDkBQ1xRNQcmf6ehUyXV65rQd6jn8qgqFtJz/GQKE055h2TJPcpowfDQze c8c29/tqA2b6i4nQOm7l7nDV0WNykxVuUl92Na7G5iuwtnuI78TjDddBVDwtKa6VuxU6vS2MwTNz keKQr1Y3Dxe35P15kIHcYOxCulCkW/hOS7aFJ6pJP2Q1MQAvqz4rn6mTOzNc8NFqcRApd8LRxAkF tT3+bpN+M7pxqiILFj551jc6y9tZL6kWwVilir1vkPppIOv4FhcK/MtNBLU+HSKdaJZCLoimRJKV Tf5jiP9zrnvDCX809nsc5ardylVyNqtvWhysF+tsSfIDNKFfM8U17TtNxdjOe1tSdS4qgSybF6u6 6d/IwFeQouAhblg65FYPx9AaSEJiNS59dz+sQ3ojl/HZd1YVDc6D6CnUQ1KmQtTyoiMEPgiQ8= X-QQ-XMRINFO: OWPUhxQsoeAVDbp3OJHYyFg= From: Zhang Shurong To: pkshih@realtek.com Cc: kvalo@kernel.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, Zhang Shurong Subject: [PATCH] wifi: rtw89: debug: fix error code in rtw89_debug_priv_btc_manual_set Date: Sun, 9 Jul 2023 17:59:06 +0800 X-OQ-MSGID: <20230709095906.1162670-1-zhang_shurong@foxmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, HELO_DYNAMIC_IPADDR,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,RDNS_DYNAMIC,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no 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 If there is a failure during kstrtobool_from_user() rtw89_debug_priv_btc_manual_set should return negative error code instead of a positive value count. Fix this bug by returning correct error code. Fixes: e3ec7017f6a2 ("rtw89: add Realtek 802.11ax driver") Signed-off-by: Zhang Shurong --- drivers/net/wireless/realtek/rtw89/debug.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/realtek/rtw89/debug.c b/drivers/net/wireless/realtek/rtw89/debug.c index 1db2d59d33ff..35fe6b4ad9b3 100644 --- a/drivers/net/wireless/realtek/rtw89/debug.c +++ b/drivers/net/wireless/realtek/rtw89/debug.c @@ -3192,9 +3192,13 @@ 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)) + ret = kstrtobool_from_user(user_buf, count, &btc_manual); + if (ret) { + count = ret; goto out; + } btc->ctrl.manual = btc_manual; out: -- 2.30.2