From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C46F535A956; Fri, 9 Jan 2026 12:30:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767961808; cv=none; b=WF8GwdySIOzJMvMvKWa8BKZAxQi7b2qIVTGzRnGe6MChAQRv7ibCezUnJf9jrgjWUZ0jkQMF+iUCl2mb8BZmHR7mamriHWu216InC9HeuFqXbZQOxE7KGsfKkrE2vZ803GqbZeOdm5e399+vVfZ+fIiBSZNqVRVQTkQxBJhrsgA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767961808; c=relaxed/simple; bh=WOsqTEUdC5Utn5YO7i2Y9xuFX+Hd87UE01C2i1HBfsM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LVZz+QVFlHt2beUPCqi9ppnXRdBwBUbW/w21yvWvQ81wYWhSgzbpc9MTR+aHCf8EZgaZv2G162GA2tQbFEYkZZmi1FWYz9cuNT9xzMzJ1F2BDAS01JszG1ykg6t6JKfqDy+7EexAAG/tsvcG6TZbddHPbFberbhurLvujKAmcFs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Ujvtyz0P; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Ujvtyz0P" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 40CF3C4CEF1; Fri, 9 Jan 2026 12:30:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1767961808; bh=WOsqTEUdC5Utn5YO7i2Y9xuFX+Hd87UE01C2i1HBfsM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ujvtyz0PtFTKK0bwg8sxpp6BWp75ZSRcTXpVyPS0xAVvyPb+No7Idm7JXIDTpisRW Bl0XjCaUQhRDUtIVbJ4NWFIi5MQjfWSh1n9XFpIEZPQyPeMfl6uXUR5+N40ukbgGna GqUQ1zwP9C1VZGKA0yz5xFzaRoLQHhaz2jSJII3g= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Zilin Guan , Lorenzo Bianconi , Felix Fietkau , Sasha Levin Subject: [PATCH 6.1 144/634] mt76: mt7615: Fix memory leak in mt7615_mcu_wtbl_sta_add() Date: Fri, 9 Jan 2026 12:37:02 +0100 Message-ID: <20260109112122.873664268@linuxfoundation.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260109112117.407257400@linuxfoundation.org> References: <20260109112117.407257400@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Zilin Guan [ Upstream commit 53d1548612670aa8b5d89745116cc33d9d172863 ] In mt7615_mcu_wtbl_sta_add(), an skb sskb is allocated. If the subsequent call to mt76_connac_mcu_alloc_wtbl_req() fails, the function returns an error without freeing sskb, leading to a memory leak. Fix this by calling dev_kfree_skb() on sskb in the error handling path to ensure it is properly released. Fixes: 99c457d902cf9 ("mt76: mt7615: move mt7615_mcu_set_bmc to mt7615_mcu_ops") Signed-off-by: Zilin Guan Acked-by: Lorenzo Bianconi Link: https://patch.msgid.link/20251113062415.103611-1-zilin@seu.edu.cn Signed-off-by: Felix Fietkau Signed-off-by: Sasha Levin --- drivers/net/wireless/mediatek/mt76/mt7615/mcu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c index 3dac76e6df4d2..53f6766938ae2 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c @@ -869,8 +869,10 @@ mt7615_mcu_wtbl_sta_add(struct mt7615_phy *phy, struct ieee80211_vif *vif, wtbl_hdr = mt76_connac_mcu_alloc_wtbl_req(&dev->mt76, &msta->wcid, WTBL_RESET_AND_SET, NULL, &wskb); - if (IS_ERR(wtbl_hdr)) + if (IS_ERR(wtbl_hdr)) { + dev_kfree_skb(sskb); return PTR_ERR(wtbl_hdr); + } if (enable) { mt76_connac_mcu_wtbl_generic_tlv(&dev->mt76, wskb, vif, sta, -- 2.51.0