Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3023912rwb; Mon, 15 Aug 2022 16:21:35 -0700 (PDT) X-Google-Smtp-Source: AA6agR4XJbhrT9Kt6NfVxQOhXh7ZlMfGStos1cm5YNo2LppHjsrZUqLQsNV3hBPZgNkS1tBcRs37 X-Received: by 2002:a17:907:7b83:b0:730:8649:9836 with SMTP id ne3-20020a1709077b8300b0073086499836mr11907174ejc.0.1660605557598; Mon, 15 Aug 2022 16:19:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660605557; cv=none; d=google.com; s=arc-20160816; b=jTDmWf8fzEH38IkvPlmAIseJ+FnFnxybSS/tdZpJ/yTt4atLzR2KiCePg3ilhZsO9s aOMPQCcCbSXjF3KhyjLrhFWUxn3gzGP2Z7JW07p88AwKgqozkylCJX4kADpPN9EIeR9w e9JwkXaMpGQ0aJsxBeRJL7S22vkCak+RBt9FRVX7l4m9CBu6aB56y0oKkYnZsWJgzZLr J/DOZntrzI+EfLSWqbxQ9eg8UBLqCW9IcLBsiTvKWUeeEHP2IpqcTKMcwGynHvCeL7wQ hUJrqNucIh2PHPgYTBcO1OQeHhuGWtUn6gy817eD619lK2EGNWIbjwhr6bAOhZ+n+jbJ +xVQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=AGEn/dyPaeBIdYtbg9cmnbTJ+O3i+QhrobQp64feDbo=; b=kMZFR9tBxhPW0IUZN5P/12YLezhf3v2Vqhw8/aaal1RrFo9vrcKD7ifHe8zGPdo7RX /YdbKM3290ssZKBZT6BkeDXKhLDx4OZGRdGvv+Py4v4wmkcUk5s54Vwo8SdbhnlR9Vpm 3/SzuYyEHjn5v5hXjA9quIbDX63PESxtSbWvLUboQbQ46uQqtXZdB/kM6vfncmza7NaE u0NR4PgL4JOyidyreFCSiZ9vrM8f/8VEMeAcI2YlLF3H8RuMTsYrRZI8ExHWjOBLBEQ3 ++8tnTsiYpjQBwxopjyOsypTiQt1kKQ5wOx7WFeoGZZUaIKrApXzUAJDnFEuW6SQ4eoO eI2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tBsjXT47; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l4-20020a170906794400b00711da52c6e4si9176414ejo.309.2022.08.15.16.18.52; Mon, 15 Aug 2022 16:19:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@linuxfoundation.org header.s=korg header.b=tBsjXT47; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346714AbiHOUxr (ORCPT + 99 others); Mon, 15 Aug 2022 16:53:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347331AbiHOUvx (ORCPT ); Mon, 15 Aug 2022 16:51:53 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BEF0164C6; Mon, 15 Aug 2022 12:10:25 -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 ams.source.kernel.org (Postfix) with ESMTPS id ECF81B8110A; Mon, 15 Aug 2022 19:10:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 62675C433D7; Mon, 15 Aug 2022 19:10:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660590620; bh=UiuXq+O+TWvZvtGWtPyiiBd9mUZBPmF5j2zcrxg92eI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tBsjXT47vG67w0yBk8kPCwwlqrg1P9VjJap+Q8oddo3RfdHjf2VIPO95sV4D8ym+W P2XwnKs2IpLafT8cWfJSHqPtgvGoIMXYoUtWGiuefv1T0DkNZoKp600T6vf9SNlSyv Ud9N1BO85k+J1xwcdv1W5B/pPG/F+XLZyXU+yaHk= 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.18 0317/1095] ath11k: fix missing skb drop on htc_tx_completion error Date: Mon, 15 Aug 2022 19:55:16 +0200 Message-Id: <20220815180442.908369248@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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-kernel@vger.kernel.org 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 >= 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/ath/ath11k/htc.c index 6913b7494b9b..2de1e953a539 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_base *ab, u8 eid; eid = ATH11K_SKB_CB(skb)->eid; - if (eid >= ATH11K_HTC_EP_COUNT) + if (eid >= ATH11K_HTC_EP_COUNT) { + dev_kfree_skb_any(skb); return; + } ep = &htc->endpoint[eid]; spin_lock_bh(&htc->tx_lock); -- 2.35.1