From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=148.163.150.75 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796314158; b=a0NhU1Y8+lJe96VVh8lNlAVV90rGpjmZQHdWWfgkDGOOnWV8k3so0gITP2EDUUEGbzFA lkRuCk3L7zrtbYn6dU9VMRSq5ijnt6FPR0eDkicdK+EnoC3A2YJByIbrxZvkVsxByWp6X y5b+4FbHKa8ItqhdTcu2x/YBg9AJ6aPWHyVn2MnBdQLxkHUaltXi6IENWt9QcOT4sxp+h Kg1cUOVBntR1SEjSwYbP5ikaUiCBxB4ZoJNy2DRDvUkH1OhVL04r+sjN77sz5VH3W+sIv G1/MQQR7/X+9/GGQnO5S3X4WMjnqOclbLZldrsYa8+aAlQNwSJ5Dl0zbvOXke9D0Rfw== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796314158; h=DMARC-Filter:Received:DKIM-Signature:Received:DKIM-Signature: Received:Received:X-MS-Exchange-Authentication-Results:Received-SPF: Received:Received:Received:Received:Received:Message-ID:Date: MIME-Version:User-Agent:Subject:To:CC:References:Content-Language: From:In-Reply-To:Content-Type:Content-Transfer-Encoding: X-EOPAttributedMessage:X-MS-PublicTrafficType: X-MS-TrafficTypeDiagnostic:X-MS-Office365-Filtering-Correlation-Id: X-MS-Exchange-SenderADCheck:X-MS-Exchange-AntiSpam-Relay: X-Microsoft-Antispam:X-Microsoft-Antispam-Message-Info: X-Forefront-Antispam-Report: X-MS-Exchange-AntiSpam-MessageData-ChunkCount: X-MS-Exchange-AntiSpam-MessageData-0:X-Exchange-RoutingPolicyChecked: X-OriginatorOrg:X-MS-Exchange-CrossTenant-OriginalArrivalTime: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-Id: X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: X-MS-Exchange-CrossTenant-AuthSource:X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-FromEntityHeader: X-MS-Exchange-Transport-CrossTenantHeadersStamped: X-Proofpoint-Spam-Details-Enc:X-Proofpoint-ORIG-GUID: X-Proofpoint-GUID:X-Proofpoint-Spam-Info:X-Authority-Analysis: X-Proofpoint-Virus-Version:X-Proofpoint-Spam-Details; bh=SmRr21sDsDpXbzThn4UOncBwz8ceeWHhFTG1Fmpl1j4=; b=3nWAkjxIYl1iPEccv6uEP1GRzN2VJm24es1KPqUBLGupDHPNfCTVf60ACcAoXuSoeG8k 1Sw0Ybb0a2NQP+47yNwlhQ1c0hViCGAFaFzh3XDoq+3DNvHSrJilp23Oyz+zFgJVV6F9N L3/4iEo8wyhbGJNOP+bx67rEakW4o1CvFK1JITz4nkCVHe3hkqgk0Zi06QL/+zuH1kfzS esh/HZVFwa/Tm77e48AYVIk74b2vdXTNfF8sg3dgEgHThI9u4a5VAXWYgN7/pbg88IRYB yh/3fWFV11rU5tgOwyGfw+MoIRk8RpLBPobdJFAeZQMWu/VSIOIkMCLvUNWQfEcuh1Q== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass header.d=ti.com header.i=@ti.com header.a=rsa-sha256 header.s=proofpoint-05-2026 header.b=M8D7xl0T; dkim=pass header.d=ticloud.onmicrosoft.com header.i=@ticloud.onmicrosoft.com header.a=rsa-sha256 header.s=selector1-ticloud-onmicrosoft-com header.b=CDyN+hJE; arc=pass header.oldest-pass=0 smtp.remote-ip=148.163.150.75 Received: from mx0a-0002e601.pphosted.com (mx0a-0002e601.pphosted.com [148.163.150.75]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 05748606A322 for ; Thu, 3 Dec 2026 16:09:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 05748606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ti.com header.i=@ti.com header.a=rsa-sha256 header.s=proofpoint-05-2026 header.b=M8D7xl0T; dkim=pass (1024-bit key) header.d=ticloud.onmicrosoft.com header.i=@ticloud.onmicrosoft.com header.a=rsa-sha256 header.s=selector1-ticloud-onmicrosoft-com header.b=CDyN+hJE Received: from pps.filterd (m0380145.ppops.net [127.0.0.1]) by m0380145.ppops.net (8.18.1.11/8.18.1.11) with ESMTP id 6B3FoDgO2130165; Thu, 3 Dec 2026 10:08:54 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= proofpoint-05-2026; bh=SmRr21sDsDpXbzThn4UOncBwz8ceeWHhFTG1Fmpl1 j4=; b=M8D7xl0T6d9CrU5g0DCC1eZxseRPoOe86SSb1mDm4nJwKoA38egu0Jxux uNYsiiDYNgnl3W1CisgSKf0mw0o3cMjEaMS2xBU+Ie7b0MYakAygdKnc4eNuQZtA lBLM5HkSL4WicXwj/Cr/ooCzrYTuuwEFZ4L6NIC+HCFo7EGbWxhunX0RYXIX8bP9 qKvD1srZvSxr2UyECIt4qNPkFJXK7NXvvPGaa8XYlhLSVmXenF5USCpOVFbDPMu3 kLypWnF6aaiirsA+DZ9FdSKkXnJpaiEER5/r2KQg9rKQsr7y63LkApSUM+plxJiT cSWRfQQj7TG0SglgiE2iXtyXCc6bg== Received: from ch4pr04cu002.outbound.protection.outlook.com (mail-northcentralusazon11013071.outbound.protection.outlook.com [40.107.201.71]) by m0380145.ppops.net (PPS) with ESMTPS id 4jb1nebbxh-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 03 Dec 2026 10:08:54 -0600 (CST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=b2bJS3NkpivI/xKRAMbCjo8KbpdOVrWmJq7MKswN4NtYmQnLrothzlYrXKldExeeV0l0f5BJgA350mi42bIGZsR3T8LbdulzfhtHY+xPdn9A5eSntDI+gX1ePZXqYmSpQIF3bJRUloeujngqdr5GSB2Q2ayTYQRHAyqJhjYKh7Bqtx0uK8r7oJsRcTR1vimdDafOEfT0aOmN32joWdPx2TdnpawqTrgTyHs8c6hHNsInMCAU5yH15/dnILC7PUZnrZZujInWhDwpWtiJGQ2NoHGXiVm/EHx4reG19i3UqpjDVHk3Rpn43wu9DTuqCEQXZjK/0x5MtEfwhazm/uP6AQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=SmRr21sDsDpXbzThn4UOncBwz8ceeWHhFTG1Fmpl1j4=; b=MtMBYUUgYLPkmL6wLZyhJeIiRv0Szd2QUu/2yh7uUqdyCuOws0BPr5jxY/4i8B2/r6IzCDnSvdmuqVcgtrwVcI6BlM8zO1vtqrE20zdEERFSEBgX9WeY9ICZGTkDdMtpndi19fr4xEROd+5abyAPTZfN0Eb/3oGwacdIsPsFpT0rWgz0UDnS8GXBLOt3sjHP7/tSo0/Bh+/NPE+R+kdV/yLc2fe8fBjuQqlxZ/GQpM+saJHAMHqoU6Oyr5+ACuRtQqGEuAkjeciMTDNvYWByBoLESboVr1JLVR+wPfd5bBPXBAeaY+ZvJCZpo8aYO8FNrj/OIq6cLsQOz5A7K/ZZUA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 198.47.23.195) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=ti.com; dmarc=pass (p=quarantine sp=none pct=100) action=none header.from=ti.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ticloud.onmicrosoft.com; s=selector1-ticloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SmRr21sDsDpXbzThn4UOncBwz8ceeWHhFTG1Fmpl1j4=; b=CDyN+hJE91DNy08TTVKPSAubgU7zcz2m76KPg1azBMm5b8XEnFFeL78L7BH7Xpk37bHn5xA3gttqZ5np2iPxuTJZzvdMwev1liXznRDbPI/mtjqH2PArq4vPaqKv4A+e/n13o7I1Vjr+w5eEC+JXo1G4krVsIAhKTtXU//PZcZU= Received: from DS1PR06CA0005.namprd06.prod.outlook.com (2603:10b6:8:458::18) by SJ0PR10MB4798.namprd10.prod.outlook.com (2603:10b6:a03:2df::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.12; Thu, 3 Dec 2026 16:08:51 +0000 Received: from DS4PEPF000001C3.namprd21.prod.outlook.com (2603:10b6:8:458:cafe::21) by DS1PR06CA0005.outlook.office365.com (2603:10b6:8:458::18) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.639.12 via Frontend Transport; Thu, 3 Dec 2026 16:08:51 +0000 X-MS-Exchange-Authentication-Results: mx.microsoft.com 1; spf=pass (sender IP is 198.47.23.195) smtp.mailfrom=ti.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=ti.com; Received-SPF: Pass (protection.outlook.com: domain of ti.com designates 198.47.23.195 as permitted sender) receiver=protection.outlook.com; client-ip=198.47.23.195; helo=lewvzet201.ext.ti.com; pr=C Received: from lewvzet201.ext.ti.com (198.47.23.195) by DS4PEPF000001C3.mail.protection.outlook.com (10.167.23.169) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.662.0 via Frontend Transport; Thu, 3 Dec 2026 16:08:51 +0000 Received: from DLEE212.ent.ti.com (157.170.170.114) by lewvzet201.ext.ti.com (10.4.14.104) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.45; Thu, 3 Dec 2026 10:08:34 -0600 Received: from DLEE203.ent.ti.com (157.170.170.78) by DLEE212.ent.ti.com (157.170.170.114) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.45; Thu, 3 Dec 2026 10:08:34 -0600 Received: from lelvem-mr05.itg.ti.com (10.180.75.9) by DLEE203.ent.ti.com (157.170.170.78) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.45 via Frontend Transport; Thu, 3 Dec 2026 10:08:34 -0600 Received: from [10.249.32.128] ([10.249.32.128]) by lelvem-mr05.itg.ti.com (8.18.1/8.18.1) with ESMTP id 6B3G8Xvu3872524; Thu, 3 Dec 2026 10:08:33 -0600 Message-ID: Date: Thu, 3 Dec 2026 10:08:33 -0600 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] soc: ti: knav_dma: fix device node leak in of_channel_match_helper() To: , Nishanth Menon , "Santosh Shilimkar" CC: , References: <20261110101131.443-1-zhaofeng2@cmss.chinamobile.com> <20261123065006.275-1-zhaofeng2@cmss.chinamobile.com> Content-Language: en-US From: Andrew Davis In-Reply-To: <20261123065006.275-1-zhaofeng2@cmss.chinamobile.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS4PEPF000001C3:EE_|SJ0PR10MB4798:EE_ X-MS-Office365-Filtering-Correlation-Id: 78b4ab17-07ca-4aa3-5beb-08df5157b8c0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|82310400026|36860700016|1800799024|23010399003|4143699003|261009223027099003|22082099003|18002099003|56012099006|10067099003|261021121427099003|261021123027099003|261028144727099003|261102123227099003|261022105027099003|261026121527099003|261026140227099003; X-Microsoft-Antispam-Message-Info: OHt9EAX+/iCV4CfOMrz16MDBbUEKfnkKCA2798sPEnieQbYgId7ggwIlPzpJfXS7g0i5vY4X8MTU3npJS8FnnYAF3HbAU5Icoyng8aB7hy3A4mIfefhh5drRj16rBk59VsaR4E3o2/46zpL2wWRuYFmEKaM034gc+6jjgNzI6bVShHesozxIp4POGiDFvxs/NfaHlBPImQYtFLk3DfMe0jMwFm0c33WCkKEzsGCegxY0MLVixl64DYeFaH9bM5rVy47DNMQrEbMyZEqYYxOhHWzu7ORMZuDOYmG7iVRDRzRyNDNb3D5Irv+i5y9khL7GokP+ZUWWr6tvBC15yS8C7ZJ/n/8WQGaAvExkX2u5m3xJtIHWprfbr2Xh+y2Qdl2NB3Fw4AenbOmInC6eqzUXYNYSeH0+K1JZ/ieWJ1+pxTIFEIjqgsfwqV16gcZN6/eq+FYN7xvcUS/WKfqlwJ4MVloHXHUQjIz2aZPzT2iyu/7+VY0GT1qSQcmlNEMRiHr8nLJIty7qUgbLvT5d8Hes5urcJSFujmQURL0YnrPV685lB0j3/TrQZ2BsdnmJ3sWe9GpzjfjJ1/t5mPZrsv/a9spNMClsUgxOKJ3BWUO7Z+NvBuDil9fHjvzVm/Q3ocbTqkcuWZXz3x/r2pggaHYOUNrqE78Yoeg34AYUMV2BaDVFWqO0AeHwSU5cTXbb8UN5Wigp6PUUmioFOcZKKz4aAg== X-Forefront-Antispam-Report: CIP:198.47.23.195;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:lewvzet201.ext.ti.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(82310400026)(36860700016)(1800799024)(23010399003)(4143699003)(261009223027099003)(22082099003)(18002099003)(56012099006)(10067099003)(261021121427099003)(261021123027099003)(261028144727099003)(261102123227099003)(261022105027099003)(261026121527099003)(261026140227099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 5+VFKc/seZvi137ju3T1+U1kAGuuADWd9XebiJWgaiEk7By4K7cNYU6h5OrlbBW3Ue14aBtAHYQ9U87aG8XUgmtW39XrmDhFNFpJyqY37IWL2XZ8rX45LEfy6/92SCPesXnoh5Bk8HO/Ulp4ZPyF6NZ/FOs6fYRDHYmYBG/oPoJ2zGvgbx4eY3kZBW9FHUHDq+9fPlu/NpPAC5r4JLztLsJ1/YEeLLarwOmJAepSadyFPiPJZVi72jxcFkpjMUCSr+uqJ4p53asRcejNsV8a5vL7p8NHSEtywMed0108NGuhY9QQRqthxzcGvVq8PfU+K6tmbo0fJMNJ/dggE8VmhTFg+HdvjxCCpaTc1+c0zb/mS5PY1qTtsZ/eLvyo0IEBmxj1YW5AErzpEWWGrgLbnEdkFI6obWI8+H4jGzJ+lYiahsmUPBCjoTc7WfI00o0Y X-Exchange-RoutingPolicyChecked: XggBdShMD2ltj6rdyIRFiT7Rt1ouWr7WVkkpK3cXB6lrZdktDFK7+FYnFGn/44aI2dlMOT5LFdT2mN57WCv2dFY5zJagdPQ+imEFVjHssJVE3sDyfZx2zOPF7doQNkokU1JpJWMT3dz48MKL9I8UTHmHPotDCc7CTHuLNSuyqUyggvrDGczFhInNUiZs/MHBKGEvLLkfogK3wPqF1JwZ/5QMtcG2oj5eyLXvVOvig5Ce01/ZxNm5YGCIKiuZ/vqn/RtNRs1AqVLVafeTrbPpZnjubMN3C+V8/KtwtDZGZd5yR4z2/lxo6N0Htashm/Dv1QpOsUwbjr4GbdlWUSq5uA== X-OriginatorOrg: ti.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Dec 2026 16:08:51.2640 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 78b4ab17-07ca-4aa3-5beb-08df5157b8c0 X-MS-Exchange-CrossTenant-Id: e5b49634-450b-4709-8abb-1e2b19b982b7 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=e5b49634-450b-4709-8abb-1e2b19b982b7;Ip=[198.47.23.195];Helo=[lewvzet201.ext.ti.com] X-MS-Exchange-CrossTenant-AuthSource: DS4PEPF000001C3.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB4798 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMjAzMDA2NCBTYWx0ZWRfXy9tU7G6kSdBQ OcO4ScLQ/PPgiQJUCTnfQ+25D3ca0qAeyPOzepdrjimdnOnLAQ1vw4TnNsLsGtqI6LrRJvIplJT sG/RLRD7Ubby73rFyCTOQHZSjq38J30hO6aT2M2ShawINlNwjMZ0/46c1T6ws3k6e1A/fub6lrA f8lhuFyH0H7hJOlIrJLbQShtETEumJH16GXG8Ji5h+Mhhs8n90bR3v3AGxvbmIR1bNW/pLfFBnj 5lyC4olwgF+ElgYx47i3mohWz2/0gqfHbEHSQHoZuMsBe4Z5ONkPhTuu+DVQu86S0F40t3nFlFM BjS33ALhatSovnt/5qSnK6e12J4V+UucPzvSuq26NyWu5JvlxzyRIyt9ffhzpMkKZ9TOPZiCasS gUL/RdQKXz6u9q2ava5eqIrtnaqvEikMsE6uSuxTqqeNb/oHNyAZFd22R4aXgv8vHvTNWc5/b3l +SrhhBvdK6Lp3y0hahQ== X-Proofpoint-ORIG-GUID: WSiAj8iatnZGAPBwAOoB_I11HKALzAoH X-Proofpoint-GUID: WSiAj8iatnZGAPBwAOoB_I11HKALzAoH X-Proofpoint-Spam-Info: AW1haW4tMjYxMjAzMDA2NCBTYWx0ZWRfX6EgqjutJl7Lu 2JDp+go8NtzZjAJ/0hort0FwASsNumO+k6syOloMvC95Ng/MG7HqIUAO1FUhpMQC7DBnvSik+bJ 4O8KoNl65/VxYPTjZ8pWAi/RFarxfvs= X-Authority-Analysis: v=2.4 cv=UYXE26SN c=1 sm=1 tr=0 ts=6b119416 cx=c_pps a=eHfeAi0ej4loD7KcX6Y+qw==:117 a=f+v6EHfkeJbVwR46tk4DMg==:17 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=IkcTkHD0fZMA:10 a=pUM-KoujPXoA:10 a=s63m1ICgrNkA:10 a=AlMIdn_sM9wA:10 a=VkNPw1HP01LnGYTKEx00:22 a=Z8NIEmU8O1QQgoT56wFK:22 a=gO1vWkAQAl3rybz1DQOp:22 a=R5C9hjxsAAAA:8 a=9ySrZQGeEfbRfSS-pEwA:9 a=QEXdDO2ut3YA:10 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-12-03_04,2026-12-03_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 bulkscore=0 suspectscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 priorityscore=1501 adultscore=0 spamscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2612030064 On 11/23/26 12:50 AM, zhaofeng2@cmss.chinamobile.com wrote: > From: Zhao Feng > > of_channel_match_helper() takes two OF references: one via > of_parse_phandle() into dma_node (for the ->name string handed out > through *dma_instance) and one via of_parse_phandle_with_fixed_args() > into args.np (for the channel number). Both are leaked: > > - The three error paths (property match failure, fixed-args parse > failure, missing args) drop neither dma_node nor args.np. > > - The successful path leaked both prior to the initial fix. > > Drop dma_node on the two error paths present in upstream, drop > args.np on the one error path where it is obtained, and on success > transfer dma_node to the caller so that knav_dma_open_channel(), > which only uses the ->name string to locate the matching DMA instance > within the function, can release the reference once the lookup is > complete. > It looks like dma_node->name/instance is also printed out in some error and debug messages also, which is why you do the of_node_put() until the very end of knav_dma_open_channel(). Would it be easier to just make and return a copy of the ->name which gets freed instead? (or pass in a stack char[32] since that is the max length of the string we compare against, then we don't even need to free it either). Andrew > Fixes: 88139ed03058 ("soc: ti: add Keystone Navigator DMA support") > Signed-off-by: Zhao Feng > --- > v2: also release dma_node on error paths and transfer it to > knav_dma_open_channel() for release after last use, per review > from Nishanth Menon. > > drivers/soc/ti/knav_dma.c | 17 ++++++++++++++++- > 1 file changed, 16 insertions(+), 1 deletion(-) > > --- a/drivers/soc/ti/knav_dma.c > +++ b/drivers/soc/ti/knav_dma.c > @@ -364,7 +364,8 @@ > DEFINE_SHOW_ATTRIBUTE(knav_dma_debug); > > static int of_channel_match_helper(struct device_node *np, const char *name, > - const char **dma_instance) > + const char **dma_instance, > + struct device_node **dma_node_out) > { > struct of_phandle_args args; > struct device_node *dma_node; > @@ -378,15 +379,20 @@ > index = of_property_match_string(np, "ti,navigator-dma-names", name); > if (index < 0) { > dev_err(kdev->dev, "No 'ti,navigator-dma-names' property\n"); > + of_node_put(dma_node); > return -ENODEV; > } > > if (of_parse_phandle_with_fixed_args(np, "ti,navigator-dmas", > 1, index, &args)) { > dev_err(kdev->dev, "Missing the phandle args name %s\n", name); > + of_node_put(dma_node); > return -ENODEV; > } > > + of_node_put(args.np); > + > + *dma_node_out = dma_node; > return args.args[0]; > } > > @@ -403,6 +409,7 @@ > { > struct knav_dma_device *dma = NULL, *iter1; > struct knav_dma_chan *chan = NULL, *iter2; > + struct device_node *dma_node; > int chan_num = -1; > const char *instance; > > @@ -411,7 +418,7 @@ > return NULL; > } > > - chan_num = of_channel_match_helper(dev->of_node, name, &instance); > + chan_num = of_channel_match_helper(dev->of_node, name, &instance, &dma_node); > if (chan_num < 0) { > dev_err(kdev->dev, "No DMA instance with name %s\n", name); > return NULL; > @@ -425,6 +432,7 @@ > if (config->direction != DMA_MEM_TO_DEV && > config->direction != DMA_DEV_TO_MEM) { > dev_err(kdev->dev, "bad direction\n"); > + of_node_put(dma_node); > return NULL; > } > > @@ -437,6 +445,7 @@ > } > if (!dma) { > dev_err(kdev->dev, "No DMA instance with name %s\n", instance); > + of_node_put(dma_node); > return NULL; > } > > @@ -457,6 +466,7 @@ > if (!chan) { > dev_err(kdev->dev, "channel %d is not in DMA %s\n", > chan_num, instance); > + of_node_put(dma_node); > return NULL; > } > > @@ -464,6 +474,7 @@ > if (!check_config(chan, config)) { > dev_err(kdev->dev, "channel %d config miss-match\n", > chan_num); > + of_node_put(dma_node); > return NULL; > } > } > @@ -476,6 +487,8 @@ > > dev_dbg(kdev->dev, "channel %d opened from DMA %s\n", > chan_num, instance); > + > + of_node_put(dma_node); > > return chan; > } > > >