Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp229854rwb; Sun, 25 Sep 2022 19:24:38 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5Bp2rAHrJjh44sN21pj0vPEp5g3zXTYGNWN9B0AQfAeVFLLsWD0kuL2nETbaZ0FjvaDR6I X-Received: by 2002:a17:907:a46:b0:782:1c1c:8141 with SMTP id be6-20020a1709070a4600b007821c1c8141mr16470666ejc.549.1664159077956; Sun, 25 Sep 2022 19:24:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664159077; cv=none; d=google.com; s=arc-20160816; b=nRa6mjQ0rSMXovR2DbdBeC+nDb8htRmiQYDK7UI/IDiCl8fdwfrL+uJu8YtDmd8QZ0 TwJdlnsyu1mf+jvcKXv44AqC1kOIxA/6ey2GSOUTpUiOkiJXXmn0390ss8eJo8IKTb4d Lem8o6m7uWmXwZcz3mf17KGNBwcwmScAES+G4humTV65HkMToD+yyhi36AAf90r2fU9N W3v/laPhFIruEuetB3KWas+/BZ1iUcfBnSiw0XXCaAuioYC2kOcEU6f/Zeia+uoLa8Rd nRz2xh3l4dw0AQpYFDlgAbJx3RFnBMZUoBMnHKCwepEejn14Q7w4jD69qxRRiPif+ePF d45g== 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 :message-id:date:subject:cc:to:from:authenticated-by; bh=KBaFsq7RT934jTo2ikm3rLYO5YXHLalxh/wVimRx1hc=; b=tCKHua/pxEA/08cJ3Nx54s/GvwxpP0u1CoYBE6PwcLL1gLs/yIbNyNwM4xBZ16h3xZ nSCy+qXQhBfc4qLyW6cz8dE4lQnLjnLGPIEE/7GOjxnpnb2oZeM0H3efS5acOzlqa87+ yyPJn6/gziKIvocDgyTivc6ADyKKWvkwj36VlTRuqmnr/zMg3v4obERexXvOyRmZ5ckW U4xOF1i8AIv/iPIHxnJgyxb4ohoDtMJ34HJjr6AJXeX6NoWUcoWj55QZLFrgqmNKiW/I YZQMWgqtXt/plgOQ3uXK8N8zwKZeVkMdL60WNRF2bOW/h5H07TD1lq9CCtHzbR25ivrh c+/g== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gs39-20020a1709072d2700b0078261e73261si12729651ejc.567.2022.09.25.19.24.15; Sun, 25 Sep 2022 19:24: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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229881AbiIZCQ3 (ORCPT + 62 others); Sun, 25 Sep 2022 22:16:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231176AbiIZCQ2 (ORCPT ); Sun, 25 Sep 2022 22:16:28 -0400 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 853E826489; Sun, 25 Sep 2022 19:16:25 -0700 (PDT) Authenticated-By: X-SpamFilter-By: ArmorX SpamTrap 5.77 with qID 28Q2FRgO4028838, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36504.realtek.com.tw[172.21.6.27]) by rtits2.realtek.com.tw (8.15.2/2.81/5.90) with ESMTPS id 28Q2FRgO4028838 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=FAIL); Mon, 26 Sep 2022 10:15:28 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXH36504.realtek.com.tw (172.21.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.7; Mon, 26 Sep 2022 10:15:52 +0800 Received: from localhost (172.21.69.188) by RTEXMBS04.realtek.com.tw (172.21.6.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.7; Mon, 26 Sep 2022 10:15:50 +0800 From: Ping-Ke Shih To: CC: , , , Subject: [PATCH v6.0-rc] wifi: rtw89: free unused skb to prevent memory leak Date: Mon, 26 Sep 2022 10:15:13 +0800 Message-ID: <20220926021513.5029-1-pkshih@realtek.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [172.21.69.188] X-ClientProxiedBy: RTEXMBS02.realtek.com.tw (172.21.6.95) To RTEXMBS04.realtek.com.tw (172.21.6.97) X-KSE-ServerInfo: RTEXMBS04.realtek.com.tw, 9 X-KSE-AntiSpam-Interceptor-Info: trusted connection X-KSE-Antiphishing-Info: Clean X-KSE-Antiphishing-ScanningType: Deterministic X-KSE-Antiphishing-Method: None X-KSE-Antiphishing-Bases: 09/26/2022 01:58:00 X-KSE-AttachmentFiltering-Interceptor-Info: no applicable attachment filtering rules found X-KSE-Antivirus-Interceptor-Info: scan successful X-KSE-Antivirus-Info: =?big5?B?Q2xlYW4sIGJhc2VzOiAyMDIyLzkvMjUgpFWkyCAwNzo1MDowMA==?= X-KSE-BulkMessagesFiltering-Scan-Result: protection disabled X-KSE-ServerInfo: RTEXH36504.realtek.com.tw, 9 X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-Antivirus-Interceptor-Info: fallback X-KSE-AntiSpam-Interceptor-Info: fallback X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS 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 From: Po-Hao Huang This avoid potential memory leak under power saving mode. Fixes: fc5f311fce74 ("rtw89: don't flush hci queues and send h2c if power is off") Cc: stable@vger.kernel.org Cc: Larry Finger Signed-off-by: Po-Hao Huang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220916033811.13862-6-pkshih@realtek.com --- Hi Kalle, We want this patch go to v6.0-rc, because it can fix memleak caused by another patch. For users, this driver eats memory and could lead out-of-memory finally. This patch has been merged into wireless-next, but I forget to add "Fixes" tag and Cc stable, so I add them to commit messages. If this works, I will prepare another patch for v5.19. Ping-Ke --- drivers/net/wireless/realtek/rtw89/core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wireless/realtek/rtw89/core.c b/drivers/net/wireless/realtek/rtw89/core.c index 16c74477b3325..e3086bf8f4513 100644 --- a/drivers/net/wireless/realtek/rtw89/core.c +++ b/drivers/net/wireless/realtek/rtw89/core.c @@ -847,6 +847,7 @@ int rtw89_h2c_tx(struct rtw89_dev *rtwdev, rtw89_debug(rtwdev, RTW89_DBG_FW, "ignore h2c due to power is off with firmware state=%d\n", test_bit(RTW89_FLAG_FW_RDY, rtwdev->flags)); + dev_kfree_skb(skb); return 0; } -- 2.25.1