Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp530835lqt; Thu, 6 Jun 2024 10:17:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVMpi3rK734v/hemZTA7TKqnxdg6a/gxwtFq/e9WbxKQ8NeycNViUZnrJy9Gj3IlIy9fM7T3dCiohVB+jaUK1kADO1o1lp9m9cpWfbJXg== X-Google-Smtp-Source: AGHT+IHGDybXNaQn3OCbEfvONoSjegfIii6wjDPTMdum+EiTrhvngq2TrZyIaSIOG32ZdSTTIz/k X-Received: by 2002:a05:6a00:9284:b0:6eb:3d37:ce7a with SMTP id d2e1a72fcca58-7040c722463mr83120b3a.21.1717694278461; Thu, 06 Jun 2024 10:17:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717694278; cv=pass; d=google.com; s=arc-20160816; b=jthAvteqbggIU0bxhyJIPc+t2IGLVuniCfEoVaZr/ZPM+wU8M/83DEWy5oJ94Ki5jj CePGAqZPfck8fRT2bBiCZ8K4AKH8Dt9e+LJuks2Ru5A6/bHouxF2JWIccE99YlAoCXs+ xg5C9fBrYRfg5kXp39i8kBseGihzGIMVF9dITlAVULVRfCSb66uF/tIL9vm4EOeI37yI csjfGvoZGIn8qjasXK5aIgrAL3PQSPDGOwPNwdbB8jJrN9KO5M4z2Bt0CYN7tTJw2N5e b2FRPTuVA77OfhUB0H1xfMcbIX8Mk5tJE2zNRXLq1JmvZf0yp1zgKtWerO5+ayoA0SP3 QXhg== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=n0iQnfdu3uPvN6Xawc6tflmJqK/PX2AqNwmDw9u4V/k=; fh=diZmGYJcu01zmNbcPcyhEp2Q9qdQcYqGq04YRZeL26M=; b=BBY+lOJ8LKwGWb4d/R09yvk9lgLSW+xGtpGqtdazis3a9Y0ybaFCngLXc4YG0Lv1Pm P/GbNN73SxqmOkIRvgzGIhjurMy5P/YGusXxA9mJcdP92vw2TDL5GTwfErimRO+5KOam /XIlg4U2o6fwaO80O7aYCBuaNbbLJibC3VEXwPh7F+Xh4NAaxxPx8B0Sl+kx8GADGmPw Gf2ZA2SHxh+N/ZYm/19OWvRMU5j6Ze2qLKZHGqmfzvigGINSa/qDE2FJJ4QeH1tW7JGd H/m04/qYWSSlh/YQ1bBEkFm5N1dDsD5KaKiR61pHydkEJaecP/2CMHgjlyL1PBsLOCSi ITPw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=ZeL5egzj; 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-kernel+bounces-204755-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204755-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6de262bfe8bsi1452411a12.295.2024.06.06.10.17.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 10:17:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-204755-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=ZeL5egzj; 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-kernel+bounces-204755-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204755-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id A67992937FA for ; Thu, 6 Jun 2024 17:01:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 63AE91993B5; Thu, 6 Jun 2024 17:00:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="ZeL5egzj" Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.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 4A73F199242; Thu, 6 Jun 2024 17:00:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717693213; cv=none; b=e7HWut8tvovQs/wmlxEdOB0NKpgSlF1stbngNjUsaVfAwZxGUNkLWxy4+MAzKTiIsNHNW3/Pzkyc8wFK1Q9lOvYGZXfNi9JKdRczqg1r7BYp1XoVQ+MgSlTJ96wMfW3gO9sgRuvjgykGdT/naPTsKQyREmRav9Csj3n3QmOj+hk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717693213; c=relaxed/simple; bh=+mjq54ZflPu+vAODsuWCCdROJg6xEokZZODQUD7KU28=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=YE7PyOcGccqwmZDrBQqzKCHkkLpLL+mjNHwY/OmhRxTUdWmyPbOKDJc0mUJmzl60zTPC5BQC6D2Q6H4iRZQdSQmDTxBkbqHgAzRVdJO72Zviu/gj8gfsqmwxOstSWT6HSImMyBxN+bQitKZBWhI9XCvxbpgCm6if6hm+g7bxcj4= 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=ZeL5egzj; arc=none smtp.client-ip=205.220.168.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 (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45684oso014039; Thu, 6 Jun 2024 17:00:07 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= n0iQnfdu3uPvN6Xawc6tflmJqK/PX2AqNwmDw9u4V/k=; b=ZeL5egzjMsiTrwBI cZSgOdbyZTuMbk5VplF5tOV7AeTViRmrY6h2TZupLHgyGYREujspZ0wRMhouVB/8 jrX8lxqJyngkk7Zt5PT0fDCaq1yLPJKrt5NRdgGyw2byJYORaa3rrwTZSPEAw0+5 E/B/m5IL0QIYoQoZVtiApyI0HlizA0Fw1KVi4qr+50GIqnt4dECBaeUzg6P7GI1M U97Fw5+BsPYxvivFDnWvnjIAT9ux9WbFl1TVLUrbKznzLzlsPsNZJ/iFOqsX14FV bVx8ybnR+BZlBPbc/FD99sP2es3u1/rMWyEk/cFvKOBzWg/QC7FzOEJmghcZClVR xgltNw== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3yjvxyard9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 06 Jun 2024 17:00:07 +0000 (GMT) Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 456H06RY006515 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 6 Jun 2024 17:00:06 GMT Received: from hu-ekangupt-hyd.qualcomm.com (10.80.80.8) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Thu, 6 Jun 2024 10:00:04 -0700 From: Ekansh Gupta To: , CC: , , , , stable Subject: [PATCH v4 06/11] misc: fastrpc: Fix memory leak in audio daemon attach operation Date: Thu, 6 Jun 2024 22:29:26 +0530 Message-ID: <20240606165939.12950-7-quic_ekangupt@quicinc.com> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240606165939.12950-1-quic_ekangupt@quicinc.com> References: <20240606165939.12950-1-quic_ekangupt@quicinc.com> Precedence: bulk X-Mailing-List: linux-kernel@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 nalasex01b.na.qualcomm.com (10.47.209.197) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: viJK7Nd6ytriZcL7P9pt85awy9T6brZT X-Proofpoint-GUID: viJK7Nd6ytriZcL7P9pt85awy9T6brZT X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-06_13,2024-06-06_02,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 spamscore=0 mlxscore=0 adultscore=0 bulkscore=0 phishscore=0 priorityscore=1501 lowpriorityscore=0 mlxlogscore=999 impostorscore=0 malwarescore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405170001 definitions=main-2406060120 Audio PD daemon send the name as part of the init IOCTL call. This mane needs to be copied to kernel for which memory is allocated. This memory is never freed which might result in memory leak. Add changes to free the memory when it is not needed. Fixes: 0871561055e6 ("misc: fastrpc: Add support for audiopd") Cc: stable Signed-off-by: Ekansh Gupta --- drivers/misc/fastrpc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c index 13e368279765..7ee8bb3a9a6f 100644 --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -1380,6 +1380,7 @@ static int fastrpc_init_create_static_process(struct fastrpc_user *fl, goto err_invoke; kfree(args); + kfree(name); return 0; err_invoke: -- 2.43.0