Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp1531692lqb; Sun, 26 May 2024 05:42:59 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVtakF2DSy020Yu1x+D/U8i8g2z/rSXiUnfMdfp6yiq9n3jwOh0zL6z0NQ1GjQzwxmpQELaEHVCmXCPkpu+3yMVjn3fWqSAZ6qNi05oSA== X-Google-Smtp-Source: AGHT+IEfYV5eo5AfQ43cbdxb6f0uNGQeWBvoq6sNf9eMP/gFcHgiV95IoPxPNk3Zc1ZgOz28DFnA X-Received: by 2002:a05:6a00:90a8:b0:6f3:f447:5861 with SMTP id d2e1a72fcca58-6f8f2c58b05mr8987126b3a.5.1716727379179; Sun, 26 May 2024 05:42:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716727379; cv=pass; d=google.com; s=arc-20160816; b=iNdQfsvyloFuuNqFb5I9YIP4rUSu4NJnfZIWSldTb1uTu/ZJRyYtSTYjBojB7ti8LI vp/0h88xLUnWFGIESF8LHa5AswNK13bLNPAEe0RH8RdMbmmPiiH01unRwE+bMRpW85Xh IhCY1Qw9pbDJPM4TTs9JwvYlgIPFxv8P0oZSkRF2KPMcCnVTOnwLkAh3ULLf4zlkvlol Id4JmXHLXsjv3rrfKrqk4McwUbw7O0Glu+DTh2tO5EmyiThXEV+1xG9Y8eruf8tvZphu DMgUSlxnd179VwdrLnKB2IHA0Lm7X+bW97TqFODl2FA4zIFeTuvuqkv+VUCejAXQ9M9w tGZQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=yYgAqwB0GE+MYff2t8X32ihu/xrKUChLjthQqWLcC98=; fh=GvdSpWOTOOEO++mEtOt0MOXW4RZebXmBponUWoai99Q=; b=qAo4vnZ7RrtpKsXlg8m7R0GnAHAgUoerUr2o2virjq+/aTOoSOPKoR9y7Wjy9Xx6g3 qr3QIG4Z3u9kafEZMFmSOEn7wOhAPPZkAIpu/7VYjIWKgWjsFZFyAoOXTI9oVITL3fdM qzqLv16Zri/p8uZhX604ozP1Fy91XGzvPuFnO5+xfKyLhNTjgpD8IRd6OKb98qNLHBP9 ZDlIf1N6/z94cYhTLi6hgancdCnhb1e514Qsj3Kzt3tRBROxWS0EVbBb5clNsUmHl3PZ pKiSbfZgBA5UUSD6VSUvDViPLIum0qHfUFfvLve4qYVgXpJUgxj76D4Bt4Js1fsDy9q0 60pw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=aSOs8wsb; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-wireless+bounces-8066-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-wireless+bounces-8066-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d2e1a72fcca58-6f8fc046dcbsi4678033b3a.22.2024.05.26.05.42.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 May 2024 05:42:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-8066-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=aSOs8wsb; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-wireless+bounces-8066-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-wireless+bounces-8066-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 6E3C6B20BF0 for ; Sun, 26 May 2024 12:42:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 33ACBB676; Sun, 26 May 2024 12:42:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="aSOs8wsb" X-Original-To: linux-wireless@vger.kernel.org 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 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 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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 --- drivers/net/wireless/ath/ath12k/dp_rx.c | 1 + 1 file changed, 1 insertion(+) 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; } base-commit: f8320064a28242448eeb9fece08abd865ea8a226 -- 2.25.1