From patchwork Tue Jul 4 16:55:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhang Shurong X-Patchwork-Id: 13301494 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 22D55EB64D9 for ; Tue, 4 Jul 2023 16:55:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231546AbjGDQzl (ORCPT ); Tue, 4 Jul 2023 12:55:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231533AbjGDQzc (ORCPT ); Tue, 4 Jul 2023 12:55:32 -0400 X-Greylist: delayed 319 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Tue, 04 Jul 2023 09:55:30 PDT Received: from out203-205-251-59.mail.qq.com (out203-205-251-59.mail.qq.com [203.205.251.59]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD6A71AC; Tue, 4 Jul 2023 09:55:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1688489728; bh=Iqendox+1LHXkQVpxAPqWFk4dta4jv2xlFIP2LLV47s=; h=From:To:Cc:Subject:Date; b=jIy2Drx2YcffegUqwS3IMNuQUCbHvcWGht1RH5RxEdMCTcx6LVnPzgtFAlcYQHKaH ayK5i5xjI1d180VSbBuepQOF0FoR4hIGnzYXopkUsnwmv4vPK1HTYf/6VgMX91cafA 9+i+G0bXImUULq68GfoKIqXOBWL1oZsk5YLTRAQA= Received: from localhost.localdomain ([119.136.250.51]) by newxmesmtplogicsvrsza7-0.qq.com (NewEsmtp) with SMTP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9O4FgJehGf43geW7h3IZUNqlvXmu8lyWmtIMTvmonqYi2WBDQx2xacDG Rt6Gdwk9JQBFO5Nrt1D9kYYSmU3P8IEIth07Ao+6c/ypMAv8cG X-QQ-XMRINFO: Nq+8W0+stu50PRdwbJxPCL0= 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 v2] wifi: rtw89: debug: fix error code in rtw89_debug_priv_send_h2c_set() Date: Wed, 5 Jul 2023 00:55:25 +0800 X-OQ-MSGID: <20230704165525.10288-1-zhang_shurong@foxmail.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org If there is a failure during rtw89_fw_h2c_raw() rtw89_debug_priv_send_h2c should return negative error code instead of a positive value count. Fix this bug by returning correct error code. The changes in this version: - fix some compile error Signed-off-by: Zhang Shurong update Signed-off-by: .... --- drivers/net/wireless/realtek/rtw89/debug.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/realtek/rtw89/debug.c b/drivers/net/wireless/realtek/rtw89/debug.c index 1db2d59d33ff..a679f79b85ec 100644 --- a/drivers/net/wireless/realtek/rtw89/debug.c +++ b/drivers/net/wireless/realtek/rtw89/debug.c @@ -3026,17 +3026,18 @@ static ssize_t rtw89_debug_priv_send_h2c_set(struct file *filp, struct rtw89_debugfs_priv *debugfs_priv = filp->private_data; struct rtw89_dev *rtwdev = debugfs_priv->rtwdev; u8 *h2c; + int err = 0; u16 h2c_len = count / 2; h2c = rtw89_hex2bin_user(rtwdev, user_buf, count); if (IS_ERR(h2c)) return -EFAULT; - rtw89_fw_h2c_raw(rtwdev, h2c, h2c_len); + err = rtw89_fw_h2c_raw(rtwdev, h2c, h2c_len); kfree(h2c); - return count; + return err ? err : count; } static int