From patchwork Sun May 26 12:42:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baochen Qiang X-Patchwork-Id: 13674266 X-Patchwork-Delegate: kvalo@adurom.com Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (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 5A026DF43 for ; Sun, 26 May 2024 12:42:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716727369; cv=none; b=SOH5uzUdko8uj37Erah7l1ZyX0FjHjys0YME+7X7V6ILYRKf/DKO6P1jp0WxTsTFIl7VbwB3Eq12uSsrfBvQVBXG5VbFCXuP8ci6ySO6CTU/9JjREWTgv61RgMsnzZT6tni19AhV8GiNusOCG5j72kWkPK5taLjwEtXORj3Ajfo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716727369; c=relaxed/simple; bh=uAqQ6XxvUKnoYX2OtMkPTLQo4K1mkOkcQKXErJPlvRA=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=FhbqU6BfDSI0tE/E6BoqGplreWmzChAFO2mV67zn2s7LRO79dXZQYNge/jNsBjvsNXLfll/Jig4SdrGIvesM3ZvS8lxd0IXLKnAKQIavlRMjfuPhY0u6GK23x9n5JRkF+thJ9yuMU2moISYclL3HHzyeG7ao/YK5njU2SOiHs0U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=aSOs8wsb; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="aSOs8wsb" Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 44Q9KfxT016949; Sun, 26 May 2024 12:42:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=qcppdkim1; bh=yYgAqwB0GE+MYff2t8X32i hu/xrKUChLjthQqWLcC98=; b=aSOs8wsbayoCRdhAZdGr0ubv2FDc3iYyWg0SDv 8gx6aPNfw1YcfH4asLKKNJ4BU10ZY3yTHlwGWq6FM7wA2kZ4Hp7HYuCy41jYJ3sJ p+1GrfoxVdHwxEB9my4OHaE5pAD+KZ2p+kAgu6C8srmylHU5vweKfQxBJO3VOk4e dlMtj7WksQb+3MfZNTv3FbH6cb2lSQsox/fadkH7dFVDJKuZpd42PNZs+X1vZ+wv atsLjECGnBqfqi2TtDlWQm6TcRTTILu5qB/t/uP91V/C2Ln0HKr4mpfMNVUc+OCF F9GbPiR2OYXeZdxz/9+iHJuNCrvCf6C6p2Qj/ohO1eTrEm1A== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3yba0q9qp4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 26 May 2024 12:42:39 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 44QCgcVf006228 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 26 May 2024 12:42:38 GMT Received: from bqiang-SFF.qca.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Sun, 26 May 2024 05:42:36 -0700 From: Baochen Qiang To: CC: , Subject: [PATCH] wifi: ath12k: fix memory leak in ath12k_dp_rx_peer_frag_setup() Date: Sun, 26 May 2024 20:42:26 +0800 Message-ID: <20240526124226.24661-1-quic_bqiang@quicinc.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: ALhTeVlk_etlRo1kBnmFUEmKqRwE4HQS X-Proofpoint-ORIG-GUID: ALhTeVlk_etlRo1kBnmFUEmKqRwE4HQS X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.650,FMLib:17.12.28.16 definitions=2024-05-26_04,2024-05-24_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 suspectscore=0 lowpriorityscore=0 impostorscore=0 clxscore=1015 mlxscore=0 mlxlogscore=957 malwarescore=0 spamscore=0 adultscore=0 bulkscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405170001 definitions=main-2405260106 Currently the resource allocated by crypto_alloc_shash() is not freed in case ath12k_peer_find() fails, resulting in memory leak. Add crypto_free_shash() to fix it. This is found during code review, compile tested only. Signed-off-by: Baochen Qiang Acked-by: Jeff Johnson --- drivers/net/wireless/ath/ath12k/dp_rx.c | 1 + 1 file changed, 1 insertion(+) base-commit: f8320064a28242448eeb9fece08abd865ea8a226 diff --git a/drivers/net/wireless/ath/ath12k/dp_rx.c b/drivers/net/wireless/ath/ath12k/dp_rx.c index a52b7b273540..cb1f308f096b 100644 --- a/drivers/net/wireless/ath/ath12k/dp_rx.c +++ b/drivers/net/wireless/ath/ath12k/dp_rx.c @@ -2742,6 +2742,7 @@ int ath12k_dp_rx_peer_frag_setup(struct ath12k *ar, const u8 *peer_mac, int vdev peer = ath12k_peer_find(ab, vdev_id, peer_mac); if (!peer) { spin_unlock_bh(&ab->base_lock); + crypto_free_shash(tfm); ath12k_warn(ab, "failed to find the peer to set up fragment info\n"); return -ENOENT; }