Received: by 2002:ab2:69cc:0:b0:1fd:c486:4f03 with SMTP id n12csp360126lqp; Tue, 11 Jun 2024 06:50:18 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWy6WysnIZUgXAV7Nplf42dy/lWhJCVNDfzxlBJF5ymjog20vafyNPD/o+WqeFWijETusprF/sCXTrD2jcNBeXd2Hnihf91ZPYGdVtHWA== X-Google-Smtp-Source: AGHT+IHnpfEzD4cjAkS5qxFo8MuiOAlqVrQxOEuHthRgEkQ13PegqZt4xp9cNWWbEc7YMXPDe5qE X-Received: by 2002:a17:902:dac9:b0:1f6:fac5:d5f1 with SMTP id d9443c01a7336-1f728930b6bmr39304415ad.27.1718113818009; Tue, 11 Jun 2024 06:50:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718113817; cv=pass; d=google.com; s=arc-20160816; b=sAxme8KTfYXuinrBIiA+OUtVNPZXA4uQA7LEcoDtRZytaSH8xwZ29nJdjOpOm3vhfF oTn1axuxmLlK7pnVd4psHetmzV20nHEKEqYe6ArE+fr4GYUulG9n0cBbkCHD8CEcMUgf CKFqdapT3TSCPM/2q3JiF1jHFvOh8pksQXYRkdSI6fpqVQybh7nb/w7gXFPXoV9WTDYY LwdVEArBrF0V6RVuKNv5ESROG6/hGEWenug/hD++nZ/n2Qhj6ocVINUFeDghgQWalPhS i7U3Jqd+8R1eeZMVtj44uxg1VGCwN7a9MLQN5Y8qz3y1iVc0P0nZ2sc/aOq0FYpI6KkQ v7rw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=organization:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=qFnpZuKfv5anGaEQWXghmpW7huRFJS9g4G0DObJoYZI=; fh=c5IH2dsG6n+nfkbcxXOZRyDoUE5ePO5S3ONeO3MFPS4=; b=EH4jCQ9GcTsB0zYw6aUCrwg7KLfw9yd8zBvJlsFp1Odj2oUAsM1uxcX0vWQalJDesQ jTqwtc4RL2pb52vIUp64y/y0E+5wYTHvSQ5701teb/2xZItvFoC9PAi0p4uBrXMmR6s9 T+ZJFA+d4dx3o1d5/g/n0YdcZKMaHl+sA5cAOEXnpEQm6q5r2u0+BoNMcVu5EdEi0cDX 1PLujoHs/8gHHOIPZNyM0L+0FVmhhsCJ4xsi9s1DkN3+Mu+/5CTQSiyELdgUDLPHWB0J FhQE5sQZ2Oh+rgG9kQ524pWAIN5KCbLAa2Ux5DF3RVgIN7ngbsBnFdzLgXfS4pSsHW3x O7SA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=BLro9Lih; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-210000-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210000-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.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 d9443c01a7336-1f70d1d2a7fsi40429785ad.341.2024.06.11.06.50.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 06:50:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-210000-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=@intel.com header.s=Intel header.b=BLro9Lih; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-210000-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210000-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.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 17F70282892 for ; Tue, 11 Jun 2024 13:50:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7466817D368; Tue, 11 Jun 2024 13:50:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="BLro9Lih" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.12]) (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 492471E4AF; Tue, 11 Jun 2024 13:50:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.12 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718113810; cv=none; b=OQIzbiQ6lxtQG4OKy/x4p9qF/Ja6haEmtBGSlKXrsDcwK97/bGFidLapqGyWOS9rdUBtUY8hhroHKcr1gJ0OFUbxyPDIAuRRhlwXoGP3aUMVqCvDOsKRnGi8LDKZls5OZ/S68iemFstrMJY0FhHY4EqRPwdgSY3YdF5ptChDY9g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718113810; c=relaxed/simple; bh=SEl+BDRhqHpRtt06RymqvtAudDdelCYnfVCZ/Mt8fgY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Rd+vkd8UdqCl5XpzprA0+p7XeoB3FjUu9lEkQT6saE/SQ2J96zjyZrRAZOIvlc/4kx3Aey8WJuBLgMOh88tki6d2FIX5otPQ+l1AsKSXf4lY+MUk6l1qkWvv766VnmyanZXx6kPjPEM9ltRJyRvScjLKjswhSewkmZNYsa9K+MU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=BLro9Lih; arc=none smtp.client-ip=192.198.163.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718113809; x=1749649809; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=SEl+BDRhqHpRtt06RymqvtAudDdelCYnfVCZ/Mt8fgY=; b=BLro9Lihr42FHKkeP6znxDDtvRowa4kRQY7y5IE4TukpwmBBZBiqD74H /ycnfD4MzZ5h1swGcptdIKqPipIEUXRfxnknDFOZkaMAjar9wccAsgBZf JLA9I7NwQQO/KdZ8lNiQZTJrrNhQ6Ua6wKTgQjzm7/r2xVUSIxqRFRAR1 rCV1aQB9cO/Vci6rHtrkySqIaPkiiFVlKdho6/SHfHG0A8ANlUI+Zts5A jF72DT5nCQ3mZbigPTQAOVJn9VKY0ZmKI/lZZZZSeptaNeLXmWoThHt0V rJ+jo1OiA3Hlvl0X0DFBVWzkjd7O8MEWFogqFG1aUwKncIbOGTMF/70x4 w==; X-CSE-ConnectionGUID: YJD2DVSpTWeF7JDSKmq1bg== X-CSE-MsgGUID: Wnbwty1RShuNPGQsBRgJDw== X-IronPort-AV: E=McAfee;i="6600,9927,11099"; a="18683180" X-IronPort-AV: E=Sophos;i="6.08,230,1712646000"; d="scan'208";a="18683180" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jun 2024 06:50:08 -0700 X-CSE-ConnectionGUID: HlsCw25rSzSSk8Ds3ob0rg== X-CSE-MsgGUID: EafsI8fuSeeQ89sjL4vxfQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,230,1712646000"; d="scan'208";a="39293498" Received: from smile.fi.intel.com ([10.237.72.54]) by fmviesa007.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jun 2024 06:50:06 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.97) (envelope-from ) id 1sH1sx-0000000FYUE-01m6; Tue, 11 Jun 2024 16:50:03 +0300 Date: Tue, 11 Jun 2024 16:50:02 +0300 From: Andy Shevchenko To: Javier Carrasco Cc: Xiaowei Song , Binghui Wang , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , Manivannan Sadhasivam , Linus Walleij , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] PCI: kirin: fix memory leak in kirin_pcie_parse_port() Message-ID: References: <20240609-pcie-kirin-memleak-v1-1-62b45b879576@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240609-pcie-kirin-memleak-v1-1-62b45b879576@gmail.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo On Sun, Jun 09, 2024 at 12:56:14PM +0200, Javier Carrasco wrote: > The conversion of this file to use the agnostic GPIO API has introduced > a new early return where the refcounts of two device nodes (parent and > child) are not decremented. > > Given that the device nodes are not required outside the loops where > they are used, and to avoid potential bugs every time a new error path > is introduced to the loop, the _scoped() versions of the macros have > been applied. The bug was introduced recently, and the fix is not > relevant for old stable kernels that might not support the scoped() > variant. Looks reasonable to me, Reviewed-by: Andy Shevchenko Thanks! -- With Best Regards, Andy Shevchenko