Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp3325588rwr; Sat, 22 Apr 2023 03:13:37 -0700 (PDT) X-Google-Smtp-Source: AKy350YvlGWln+1jYSDWYJQRKYI6PJYLSeYPd6Ft2AYLMSIBBtvjgZVFIAkdk7bPvZruFesJq0x1 X-Received: by 2002:a17:90b:358:b0:247:6eda:a2ae with SMTP id fh24-20020a17090b035800b002476edaa2aemr7703689pjb.32.1682158417019; Sat, 22 Apr 2023 03:13:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682158417; cv=none; d=google.com; s=arc-20160816; b=GExL7dvuoabhurS1kDzy6pKLjTrcoJ3g0PtRZljF/3z62ouJqPZ2hKpYma3cefUf8S 7ZzZp7MH42vVCgL5hlyuIOlN1q+xTvtcHFMMS7Ysi4/K4ukTuFcnYWvYAAGXH55K/MPU YPWk7aGX1LHyvzuiR6/ERrxMdd0FaP7tdBeswHVpGae9nKrfAghbfggDGkg6vR1PbDom PBofW4+KzvrGXqoSuYR0b3RE9bXpjRRdsN+BfvqjevvJJfrB2VOevi0yAUCQexd/V8H+ 7FljGuXwrgnVEpQ2GYONZqK21bEFeIeBzkEm1vUHVmwZ4TbOdRSjr37yVzJacyxZbaom HS/w== 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 :references:in-reply-to:date:subject:cc:to:from:message-id :dkim-signature; bh=8leUxeAPv62+4h4KjkbMWeydD4pGRjvCLJYv5hfyOdo=; b=ZZovPE+7B3fddN2+TRP5gIPQAZiUB+OKk7sATc3opmV5/E/HO8MMaxpckrWGqxsZ32 k7VUlF1Zwu92OOeOkOKIWzwQWLOkQnHshUWu3B+nSIskRxedLiw18ih7U4WYdBvBpHIw Rd/H0J3SLcAZQ2LJQsO/PgMM7KO6/Le+0nfg+osoeIAdJZUPEfrtnXGnhEAEHXNJjvnq m920+kQz7AfoJjAVuJULqXvw4PByzKaVXH3v5Ztp9fvJw0OwK40bdHTfejH8TL9mmq5U bWowgmJqGfpZ0qkkHDTS7xzn04ejEr4QDNt4tha1SU6ACIKUVIdwbTolOi13+A60nRte 63YA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@foxmail.com header.s=s201512 header.b=LFNKt0TV; 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 y9-20020a17090264c900b0019a74a00baesi6097440pli.87.2023.04.22.03.13.27; Sat, 22 Apr 2023 03:13:37 -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=LFNKt0TV; 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 S229575AbjDVKLp (ORCPT + 62 others); Sat, 22 Apr 2023 06:11:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229769AbjDVKLn (ORCPT ); Sat, 22 Apr 2023 06:11:43 -0400 Received: from out203-205-251-88.mail.qq.com (out203-205-251-88.mail.qq.com [203.205.251.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1BA119AD; Sat, 22 Apr 2023 03:11:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1682158299; bh=8leUxeAPv62+4h4KjkbMWeydD4pGRjvCLJYv5hfyOdo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=LFNKt0TV3shD5sVqSFrZPSkx32eBER9jc5o65n+qPhkNsDV+VFsQ3EIm2nI6k4jj3 BokLxgbk1ygO4tJSD5n7VhDoa4bl/mMf/A6d06NQMthpy089yCbWrez6MoKpIwQFQf 38h7LKYpwfjzsoHAs0p3DyQ0T7KEHsA+WDqE6b14= 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: xmsmtpt1682157919tv67qvjy7 Message-ID: X-QQ-XMAILINFO: N2tj+8mvLUD9Zr+YZf8MLVneoWmGNe7bAJvx3TdjU5X4G/ck5bqc8zmpQC3sSs ++uTtyXJWhdC0Xd5wn62+mogphn9WXzr1oj5OsecEILBMa13EoZkHMFMCBPIcAZO8DcSTD1RkQZA Xup3ou9Ycr9UqQXAHTqziDiB2IbzwtWSKT2rKu0o8LfjOQB10zdPohGMvlWjEbHlBrqqWvZzu/rC XOdDltcCym9KnTnanngTq40B85Ryxj30uSrAEJpTt831HQyRO1WRl8wpNsTynF3JQUi2jE+muVB6 AM1VAEWB6kFGgDdmB3mF3RnVh17jRUsvOjuHl7ZzHNcUxBXdChjMlc/6EUavIk3EeMP8DXkYyMp2 H9AyJlstJLArrf9B0YfcVHmFBfezDLGg+9saIgy43F39zOx9nJbtj/wXBLX25oDokg3bNEYkCUwx nsKznqVZlVszss79FquMH/tp7ABZlozoLYy2enGr/DyOiM8rl7iLZzI1CxUvpOR6P+Y/2TvHL4ZT 5YmppeNHzoxjb2VKs0thOmNrVgx9G7EMaZi5GoVM5Z5KZLdGQr9c437qyOzRjFKvnOXQxleMLQUp KtH8nm7Jb+hqD0lDZlGtGWSZzO75cKaiAGB1nkUInUaZeA2ps0BbCK0Hvx29nJuaeBZTsjaeX1oa FenmHEwiQqEi31uv2QJiMLetqFzGz/GWo+ugd2ww/VC9PT3VAPoAA32/EF9JQiEwfYDcYZr72R8H U4ymD438BWoW2ZRlI8xpApPYIW3JeOnaIs8C01mUfNd8ISLl7Hl3q/pzBjE30LEc0ljVCPTCeyqu +uoxTwkJVcF5CYtUCbwd6dMO3jrBqDdg+PEIwMAh2/900obhNmIx2In5GN7b5E6Rtm5P59kouN4l tVzNAqaX3dO+7qnfLXpAVOh9uHW5ltCNZlfNTY1EJNkgJMBkKiLplEXOOr3uEaVEIYUq+bBLqRoe Twyl1qb/InqUpYz3yC0oXUdil00sQLBa8709TFVO/4nbG2DzsL4Erzk6A2WqHoZciOh5IcCBrVAi MJJ91oD2syVWQgiSMohRgz8bnNTMAYzaTG7mkZwvIjD4RXICUCJequqBhI0RS3nVr+6gyfkg== 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 03/10] wifi: rtw88: fix incorrect error codes in rtw_debugfs_set_rsvd_page Date: Sat, 22 Apr 2023 18:04:47 +0800 X-OQ-MSGID: <38dcded193f4febdd0a7731229efe94e75d303ce.1682156784.git.zhang_shurong@foxmail.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, HELO_DYNAMIC_IPADDR,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,RDNS_DYNAMIC, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 copy_from_user, rtw_debugfs_set_rsvd_page 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 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/realtek/rtw88/debug.c b/drivers/net/wireless/realtek/rtw88/debug.c index 3c3350bb2855..d8e872ae4dda 100644 --- a/drivers/net/wireless/realtek/rtw88/debug.c +++ b/drivers/net/wireless/realtek/rtw88/debug.c @@ -291,8 +291,11 @@ static ssize_t rtw_debugfs_set_rsvd_page(struct file *filp, char tmp[32 + 1]; u32 offset, page_num; int num; + int ret; - rtw_debugfs_copy_from_user(tmp, sizeof(tmp), buffer, count, 2); + ret = rtw_debugfs_copy_from_user(tmp, sizeof(tmp), buffer, count, 2); + if (ret < 0) + return ret; num = sscanf(tmp, "%d %d", &offset, &page_num); -- 2.40.0