From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14]) (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 049FC294A10 for ; Mon, 16 Feb 2026 09:11:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.14 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771233077; cv=none; b=F9Nm/I9dLQ24m6BqcZSl7nTnG5KFztT9he8GLRBiBExverPY1DENzM71paTvD394gSEehLEePC922WtQ5RgF7TLirgGHkDagJlMuvEvHf+JmjoX9TgaTcGzOCOnqLY0r/fkwZ2Wxh7cbIdTimsajsp0KqF+CBs1wOENOrDQxdXs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771233077; c=relaxed/simple; bh=Orh2BPAq/oyA5q/2Hwhz3bJFMI2/tMIG6p5Pio6XFm0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=F8OFwBbkg+JDN2hL2LDcO3w5pg+QqjpDeX0Id6ccrqaagXdtnbaYcU86f4gBKKTuP2PhoS83H9wEdSFAa1tIpIPkErBgVE/Sl9QS4K39HyJOmrXcix5pwd757SkoScVt/CYs3YlAZfsuc6m8Fm3rXLVQ9Q/Z488iFOZ3G+X3f9U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=MeiA78Ht; arc=none smtp.client-ip=198.175.65.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="MeiA78Ht" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1771233076; x=1802769076; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=Orh2BPAq/oyA5q/2Hwhz3bJFMI2/tMIG6p5Pio6XFm0=; b=MeiA78Hty38C2ITn2jUANnHgyhID7UB9EbE35gp+9Vs/WSOUGj0Sil2o jSwM6zgFX+vRmCVG39NIezLxpoIMHH2cbRSYTg5sSj/imxbVJrs9oEQbI kMF/IoqNqsCbclZ2dS7HAdUw4E3WpNXpsVFZDf0KkDqbydTL25ZNiGXBs JX+X/N1Vo3MZqh+e3fGewSKM48XhCsuf5Tf4MmKQxDgIBBIEZg0Yz4VIE oypNY28ET9EuD6wON3QBUCGqhC7U8xdTnVL8rOxBctSFkxXK5/6Hxc6S1 ayLe1NLrZFleIjEc785KxUzD92CWEsdAUZciB8Kj/sD12phjVcUZv1Cne w==; X-CSE-ConnectionGUID: Jnc5vnXPRE+aNDBITTjfaQ== X-CSE-MsgGUID: C7bDElvjS2aR5ueZdTVvHA== X-IronPort-AV: E=McAfee;i="6800,10657,11702"; a="76153705" X-IronPort-AV: E=Sophos;i="6.21,293,1763452800"; d="scan'208";a="76153705" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Feb 2026 01:11:15 -0800 X-CSE-ConnectionGUID: GZudc9rdS3eHbzmd0dooqA== X-CSE-MsgGUID: K14hzfZgScardz/3c3bEPA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,293,1763452800"; d="scan'208";a="218075827" Received: from abityuts-desk.ger.corp.intel.com (HELO localhost) ([10.245.244.188]) by fmviesa005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Feb 2026 01:11:13 -0800 Date: Mon, 16 Feb 2026 11:11:11 +0200 From: Andy Shevchenko To: Vladimir Oltean Cc: Haotian Zhang , vkoul@kernel.org, kishon@kernel.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] phy: hisilicon: Fix OF node reference leak Message-ID: References: <20251112062246.852-1-vulab@iscas.ac.cn> <20260216084348.e2ozdqy5unvfs7qe@skbuf> 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: Organization: Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo On Mon, Feb 16, 2026 at 11:09:59AM +0200, Andy Shevchenko wrote: > On Mon, Feb 16, 2026 at 10:43:48AM +0200, Vladimir Oltean wrote: > > On Wed, Nov 12, 2025 at 02:22:46PM +0800, Haotian Zhang wrote: ... > > pcie_dev = bus_find_device_by_of_node(&platform_bus_type, pcie_port); > > + of_node_put(pcie_port); > > if (!pcie_dev) { > > dev_err(dev, "Didn't find pcie device\n"); > > return -ENODEV; > > } > > > > Note that there exists a second reference leak bug in the same function. > > bus_find_device_by_of_node() requires put_device(pcie_dev) > > Note, there is a pci_* wrapper for that. Now I re-read this and found confusing comment, please, disregard this. > > after it is no longer needed. > > Is it only a local variable? If so, it's probably okay to put it, but that > action needs more investigations of the how the pcie_dev is being used. > Also, it might be (but I don't think it is) a (double) put_device() call > somewhere else. TL;DR: the summary of this investigation should be present > in the commit message. -- With Best Regards, Andy Shevchenko