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 D4A26BA45 for ; Tue, 7 Mar 2023 18:06:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3A251C433EF; Tue, 7 Mar 2023 18:06:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1678212397; bh=O+yygR2JX2Xz6oXdCSgYNx81NXO5p7ba0VVcb20jmtA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=v7l0EDOmxT/ektZ2pyzSm4AQ0QaArp6k9nA3tplY02BI7zWvDhhes1mcLPcT3tRcE 2cp+hIo266VC6mnHaEF9hOXlONrnDM8YNUqwZ6EG8i0FTP1R8IUqso+yWima2sAnUM By4qCCqluWo1rtCz85OZme+L4mLS0z2DUSX7SvOk= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Miaoqian Lin , Leon Romanovsky , Kalle Valo , Sasha Levin Subject: [PATCH 6.1 171/885] wifi: ath11k: Fix memory leak in ath11k_peer_rx_frag_setup Date: Tue, 7 Mar 2023 17:51:45 +0100 Message-Id: <20230307170009.385793714@linuxfoundation.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230307170001.594919529@linuxfoundation.org> References: <20230307170001.594919529@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Miaoqian Lin [ Upstream commit ed3f83b3459a67a3ab9d806490ac304b567b1c2d ] crypto_alloc_shash() allocates resources, which should be released by crypto_free_shash(). When ath11k_peer_find() fails, there has memory leak. Add missing crypto_free_shash() to fix this. Fixes: 243874c64c81 ("ath11k: handle RX fragments") Signed-off-by: Miaoqian Lin Reviewed-by: Leon Romanovsky Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230102081142.3937570-1-linmq006@gmail.com Signed-off-by: Sasha Levin --- drivers/net/wireless/ath/ath11k/dp_rx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wireless/ath/ath11k/dp_rx.c b/drivers/net/wireless/ath/ath11k/dp_rx.c index c5a4c34d77499..0c53d88293eb7 100644 --- a/drivers/net/wireless/ath/ath11k/dp_rx.c +++ b/drivers/net/wireless/ath/ath11k/dp_rx.c @@ -3126,6 +3126,7 @@ int ath11k_peer_rx_frag_setup(struct ath11k *ar, const u8 *peer_mac, int vdev_id if (!peer) { ath11k_warn(ab, "failed to find the peer to set up fragment info\n"); spin_unlock_bh(&ab->base_lock); + crypto_free_shash(tfm); return -ENOENT; } -- 2.39.2