Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1121248rwr; Wed, 26 Apr 2023 10:18:48 -0700 (PDT) X-Google-Smtp-Source: AKy350YVhh26W/71VczRux/A0XpiO/9X6VXdhya0amBen/DUX/AGqgHxUdbQtGO3+Skr/69GR/zG X-Received: by 2002:a17:902:ccc6:b0:1a8:1cbb:4f76 with SMTP id z6-20020a170902ccc600b001a81cbb4f76mr23809191ple.28.1682529528670; Wed, 26 Apr 2023 10:18:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682529528; cv=none; d=google.com; s=arc-20160816; b=pUmiKbhJsQ4Pg3/RSOLTA4HbzJY+pDM18l2hN78k8QXgftupdVZ1Ug3o9Q4vx+wNTf TZAFWw7yzPUz1Rhhfq6BL9DspAH9siD2dqUFoaM9nUkNjOaZZ9ZiZVRnQjBY+uA064wN H+xyWA7hDcKEZr4ZDA8rj6pm1nLxF2tn7urHXIfdWKyuSDATiKm/KBQgai9o0TBBY0PO QhGxpVTEMQo6oOfZwuNTvMKWUn2vkgfR1dG649TyWeVJdwYpTG7cLZsa2cEcBdTLx0+q AzCPpFXUthKNbP7lyZr1cAYlAD7N4BupDjsJldixBeqhTRSjg3X8h+A1vsUMGG8ThHyu gHFQ== 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=o4udH8OtqEoEDrOP/aTcDA81yzBb2ltJxkP46cbFh5c=; b=DDFVB+dL0SOTyy273wyjbeKKL6v3zpGxiUVu2h8ePFSiuBpymA3bjaCdl+u40Xd/fV qN6Z1HSf+4EtYo0j5lNLrK/PFmDPEN5Tj26S/8CRHvfN1sa4rF46kKtSWOHJyiE6Mn40 yejwb+1H5sc1N7YhVxGPS9qeZXjKW/UInN/7DqnXHFXSlwsdLfWGcBOJwDE4FpxUUrWC zG6FjWbRstSqS0Hy3YhA5qrul1MK0V1Y6qWak5Ud+NO6Om2q3NdusI+4Yqiv2zeLAYdf p+yOh1Z1CFt0U72gt0tc+i1PmbVP/JHQP82zdmhUq1XPDHSeJERpeWRmKkKJYrOsDlxl twlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@foxmail.com header.s=s201512 header.b=juYhBBta; 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 k5-20020a170902ce0500b001a63b8e071esi16924149plg.28.2023.04.26.10.18.37; Wed, 26 Apr 2023 10:18:48 -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=juYhBBta; 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 S234631AbjDZRNm (ORCPT + 63 others); Wed, 26 Apr 2023 13:13:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233954AbjDZRNl (ORCPT ); Wed, 26 Apr 2023 13:13:41 -0400 Received: from out203-205-221-235.mail.qq.com (out203-205-221-235.mail.qq.com [203.205.221.235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7BEF194; Wed, 26 Apr 2023 10:13:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1682528918; bh=o4udH8OtqEoEDrOP/aTcDA81yzBb2ltJxkP46cbFh5c=; h=From:To:Cc:Subject:Date; b=juYhBBtayxtuIEglDGpYtnMn1Yo2+GoJLV+2HWEXQvlNFlG1rVAudJ2AwTCs8RsQr /CSTwa/e828C7Nfh7R+WkSLHD9hxmtx0FxMf1rM/ci9K5rKh85P207+PvjkTDFvKnq 8GqUzAm/xOZzXdx4dDmo/mnZbXSFbYfcw7BQzmco= Received: from localhost.localdomain ([220.243.191.11]) by newxmesmtplogicsvrsza10-0.qq.com (NewEsmtp) with SMTP id 9828290; Thu, 27 Apr 2023 01:02:24 +0800 X-QQ-mid: xmsmtpt1682528544th5jveq67 Message-ID: X-QQ-XMAILINFO: MyIXMys/8kCtWl9GEkWfk7hP4f0VtV8+04aQymT3xHvU/k9TTahy9VKkPLTZh5 io2CmzhrX4cceDZ4N2WgF/3ovWk18EE0wqMuvpvRwH5obr5nms3Q/5ESB3vwADixLKudkx4p2LuD pb9UaO/BlXQO2ikEufIf3a8lg0/v3gHJrTO2jWf0iytxddhI8pKPBtLW5uY/7tYiKcm9R4ntfCR9 4Cgw+fek5uN+bqMrhoPPHhSNXbkhUNj+PwId7N5M4IVJ+WrPZBla+cxttjEL+QWGbGc/14NnqWol EcuPtlw+zLMf2bErM2Z3FSu562Btc9EXwAO8MgmGGG1HYdUhjneGYT0IpXhzZe4UgEzdM8J1RO9l 2LSb/RYImejWvvayVWY2lwwppzv3lP01v4Izus6klBQAkfoaE4KTT2X38u9JB9LHJdQQ9rE0sLqi 3vD0UOye0N2SUj30JItjV/IokQ3hQ0LEiyaSR7GD76baekW2SxHERHXfIL7CZmwDty2R3H5HE5qE l3WHhBYkY7Hh1VJBDIyZdoVuoYfa/f0dlrOs5evtx48Vzc9yEkFNXQgtS07THzeSZm+xIAcpYD/n rUJXRShMObCcgvdmH6KN7JzAjaAm2UaxbA7tEKMB5ILlJWWs0PUZpWLkVAT4B7oo0/eqb6x3xVFb f5UlRSh33XlUdp3KG3zEjOVlLkcsh3fQqHaRLCZ1hBX53IB0+N3avaCP9j005HMEt4Nc/VIZHtD5 a7BmXZpx+UXd52yPmYCAt8o2Pfy7yv3pervDd4KNEs/506byGSaP+TgHEWJX9PxeSVJFZGseD8Uy dQnBJnmJ23G3jaeP0Fq1iOY/8ZH6UnewlZW0SR8uCCBmtJzFhkKirHw4JQ6oOqI1rFRh6QR1H2HD g12zkHKui5E9nbRK8dA9dqRuLfk1RauAE6SDdFgEEETt7TgIhGOEzCIJOgxa0os/Dd00xwE84oEj IPD5C5IXqi11/mddotZhP4h0J+4+QcEQ9ZQz+pS4N4/aBDZI45qA== From: Zhang Shurong To: pkshih@realtek.com Cc: tony0620emma@gmail.com, 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 v3 0/2] wifi: rtw88: error codes fix patches Date: Thu, 27 Apr 2023 01:02:19 +0800 X-OQ-MSGID: X-Mailer: git-send-email 2.40.0 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,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 rtw88 does not handle the failure during copy_from_user or invalid user-provided data. We fix such problems by first modifying the return value of customized function rtw_debugfs_copy_from_user. Then for all the callers rtw_debugfs_set_*, we receive the returned error code. Moreover, negative code is returned if the user-provided data is invalid instead of a positive value count. The changes in this version: - check by if (ret) instead of check by if (ret < 0) Zhang Shurong (2): wifi: rtw88: fix incorrect error codes in rtw_debugfs_copy_from_user wifi: rtw88: fix incorrect error codes in rtw_debugfs_set_* drivers/net/wireless/realtek/rtw88/debug.c | 59 ++++++++++++++++------ 1 file changed, 43 insertions(+), 16 deletions(-) -- 2.40.0