From nobody Mon Sep 29 21:14:10 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D449CC00140 for ; Mon, 15 Aug 2022 23:24:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243318AbiHOXYD (ORCPT ); Mon, 15 Aug 2022 19:24:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241501AbiHOXTM (ORCPT ); Mon, 15 Aug 2022 19:19:12 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 642F514A1D6; Mon, 15 Aug 2022 13:03:58 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E785D612E7; Mon, 15 Aug 2022 20:03:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DF4CEC433C1; Mon, 15 Aug 2022 20:03:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660593837; bh=yRT4IHXH0eUR1dS7EIU5gkV3QRpYBYJ2aPTxUU5DRiw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HVUGZmLodEhrjLjZN9P/PqVzqZrd7k6tbrRcym8FOBkqwOxbArfTJAW2elYz+Nh6u 9fYf1+EouqzZA6OI3leaSyQ5Leq52567X5NCm4uxpdpUNQHgILeuvK4eiPZM1O4I3u OY+u3jQe28hi5NIHLdPwFOaKzeEQbbEkcn7JDdNI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christian Ansuel Marangi , Jeff Johnson , Kalle Valo , Sasha Levin Subject: [PATCH 5.19 0333/1157] ath11k: fix missing skb drop on htc_tx_completion error Date: Mon, 15 Aug 2022 19:54:49 +0200 Message-Id: <20220815180452.977503852@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Christian 'Ansuel' Marangi [ Upstream commit e5646fe3b7ef739c392e59da7db6adf5e1fdef42 ] On htc_tx_completion error the skb is not dropped. This is wrong since the completion_handler logic expect the skb to be consumed anyway even when an error is triggered. Not freeing the skb on error is a memory leak since the skb won't be freed anywere else. Correctly free the packet on eid >=3D ATH11K_HTC_EP_COUNT before returning. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.5.0.1-01208-QCAHKSWPL_SILICONZ-1 Fixes: f951380a6022 ("ath11k: Disabling credit flow for WMI path") Signed-off-by: Christian 'Ansuel' Marangi Reviewed-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220528142516.20819-2-ansuelsmth@gmail.com Signed-off-by: Sasha Levin --- drivers/net/wireless/ath/ath11k/htc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath11k/htc.c b/drivers/net/wireless/a= th/ath11k/htc.c index 069c29a4fac7..ca3aedc0252d 100644 --- a/drivers/net/wireless/ath/ath11k/htc.c +++ b/drivers/net/wireless/ath/ath11k/htc.c @@ -258,8 +258,10 @@ void ath11k_htc_tx_completion_handler(struct ath11k_ba= se *ab, u8 eid; =20 eid =3D ATH11K_SKB_CB(skb)->eid; - if (eid >=3D ATH11K_HTC_EP_COUNT) + if (eid >=3D ATH11K_HTC_EP_COUNT) { + dev_kfree_skb_any(skb); return; + } =20 ep =3D &htc->endpoint[eid]; spin_lock_bh(&htc->tx_lock); --=20 2.35.1