From patchwork Mon Nov 16 11:45:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shayne Chen X-Patchwork-Id: 11908157 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D0C1F697 for ; Mon, 16 Nov 2020 11:59:28 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 30DC222263 for ; Mon, 16 Nov 2020 11:59:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="P8fSqkeW"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="Z5QFfvsV" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 30DC222263 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=hijbICoiz48HoRaQNd5MPdRED/yA212sAKUIEVeW2vc=; b=P8fSqkeWw0W3yUtDRojB+9RIOr 4YvyQqOUnTwzrFj5loUrjxWVoifiWhuCRKRQFYmAHhVlNPIxMSIgoAypquEAYefrZ4VKqdgzDCaAv 6oDptPjGqLjh0eif8dnyOAw9EXIOEHHE7WQW2hXhqSUiTfvCSoNrYbnt2OF5xbtSGXqdwEVH+/x1/ SfXIZ5obwu9rLjd9Pj9G1hermBtaDWtGGM54srDsNa8g5xLk2JB7B+/BvW/swJZKM7qcsxLOsqX76 iItZr6CdHbmVm0qn0DJ8AggXgDRbvDyZ38CBVWRjYv4njMttlXg7eFL6Z2ST800cmta7MHEebJWFV SSxtoqHg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kedAL-00047d-Ny; Mon, 16 Nov 2020 11:59:25 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kedAI-00047H-VU for linux-mediatek@lists.infradead.org; Mon, 16 Nov 2020 11:59:24 +0000 X-UUID: 85aae2963a9d4c19a17455ee156ef37a-20201116 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=WoJ93Ts4p0eTu6Mpug3n6c1gKy/R8O3+zhWhJsJXRtQ=; b=Z5QFfvsV9L9RdRdM/QhqEz8x4BygL4yH4wUsI5YxBvcVmDb8C4mZttTVuNyThQswAde9uQkqlPQjzGLZp4DjY+Q9zqFGXcMdwDiPTBf7gIuWH622If3Ybsvpi6cYYKq2NfaudsJwQf4GoeJeXewacO/tZ/iMvpCcJknLd4OnjMQ=; X-UUID: 85aae2963a9d4c19a17455ee156ef37a-20201116 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 928634093; Mon, 16 Nov 2020 03:56:06 -0800 Received: from mtkmbs08n2.mediatek.inc (172.21.101.56) by MTKMBS62N1.mediatek.inc (172.29.193.41) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 16 Nov 2020 03:46:08 -0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs08n2.mediatek.inc (172.21.101.56) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 16 Nov 2020 19:46:07 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 16 Nov 2020 19:46:07 +0800 From: Shayne Chen To: Felix Fietkau Subject: [PATCH] mt76: mt7915: fix memory leak in mt7915_mcu_get_rx_rate() Date: Mon, 16 Nov 2020 19:45:54 +0800 Message-ID: <20201116114554.15899-1-shayne.chen@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 X-TM-SNTS-SMTP: 6E7635135E97EA2994EC37618BF1404DFA992401098CD3329F22247E3E1BBC962000:8 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201116_065923_221669_6FF7BBDE X-CRM114-Status: UNSURE ( 9.17 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 MIME_BASE64_TEXT RAW: Message text disguised using base64 encoding 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-mediatek , Lorenzo Bianconi , Ryder Lee , linux-wireless , Shayne Chen Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org Free the skb to prevent memory leak. Signed-off-by: Shayne Chen --- drivers/net/wireless/mediatek/mt76/mt7915/mcu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c index 3e1f7ee..4776532 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c @@ -3515,5 +3515,7 @@ int mt7915_mcu_get_rx_rate(struct mt7915_phy *phy, struct ieee80211_vif *vif, break; } + dev_kfree_skb(skb); + return 0; }