Article View: linux.kernel.netdev
Article #847Re: [PATCH] net: mdio: mdio-mux: fix device_node reference leak on success
From: Andrew Lunn
Date: Thu, 08 Oct 2026 18:23
Date: Thu, 08 Oct 2026 18:23
15 lines
6346 bytes
6346 bytes
On Fri, Oct 09, 2026 at 01:56:12AM +0800, Haotian Zhang wrote:
> mdio_mux_init() obtains a reference to the parent bus device_node with
> of_parse_phandle() when no mux_bus is passed in. All error paths release
> it through err_parent_bus, but the success path at the end of the
> function returns without calling of_node_put(). of_mdio_find_bus() only
> takes a reference to the embedded struct device, so the device_node
> reference is leaked for every multiplexer that probes successfully.
What would happen if the parent bus was to go away?
Andrew
---
pw-bot: cr
Technical Details
Message-ID:
<ed1aa3e6-05a8-4843-ba32-8b2612099b00@lunn.ch>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-343199-linux-kernel-netdev=dewy.ruReferences:
<20261008175612.2748920-1-vulab@iscas.ac.cn>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-343199-linux-kernel-netdev=dewy.ru From: andrew@lunn.ch (Andrew Lunn) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH] net: mdio: mdio-mux: fix device_node reference leak on success Date: Thu, 8 Oct 2026 20:23:05 +0200 Organization: Usenet Network Message-ID: <ed1aa3e6-05a8-4843-ba32-8b2612099b00@lunn.ch> References: <20261008175612.2748920-1-vulab@iscas.ac.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: usenet.network; logging-data="940742"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:xaS7PfvFc87KM420hp1E8rNBrtY= sha256:OJcrCcufl6URWLIwros4VAJMJj81OzuB+2nstixV4ec= sha1:yXUFEJD+ZaLkn3+cQK4sFHUPxaA= sha256:7Pp2qN85ZdwIn4QV6sprTchyusejprbyx+XlMK+c0gQ= Content-Disposition: inline List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id D12C610F4C4; Thu, 8 Oct 2026 21:24:18 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -0.75 X-Spam-Status: No, score=-0.75 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key) header.d=lunn.ch X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GaVW2roDPFgQ; Thu, 8 Oct 2026 21:24:15 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-343199-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=lunn.ch X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id AF0A110F4C0; Thu, 8 Oct 2026 21:24:10 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sea.lore.kernel.org (Postfix) with ESMTP id 7F70530EDB; Thu, 8 Oct 2026 18:23:24 +0000 (UTC) X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F02734F3EC3; Thu, 8 Oct 2026 18:23:21 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="XGr/rzFk" X-Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (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 A15964F3938; Thu, 8 Oct 2026 18:23:19 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=156.67.10.101 X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791483801; cv=none; b=ukGpuXs5KkGnaODOXTBwvF8J4pxwPSCqOLRgjtOs/yux7A5BTokWSxQ8Lrnkgub7E9YeMNRl6+VEdrM4eC21CeTuVUPzMlfnIHUxRVE+5A5uk7SnDnUORS+su/hDbUNJyp2ZXLdXuNgXm+YBhXWM9qbCKEHs8nPBp77ONGhdy14= X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791483801; c=relaxed/simple; bh=voJiBKDo6TtLO+YJAosyPC30c8P4HYREUemQBZdTb8w=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=FciryHIK9ht9iyRhJF/9CrSr/E1WKqgAeTZOGPhj66JdyM9tKrMdQg3/5bXMd2MOfzTgsALCBOJTXBJ8RbY2rKoowOCx112R389UwtkvwKJymsvrlSDBOE9Pu9TzEVn2h5wQgkW5GpVf+urGThVfmgK5BIgH5lFtTKdN/GIVUdQ= X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b=XGr/rzFk; arc=none smtp.client-ip=156.67.10.101 X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch X-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=Wq0FegSrzp/3imzFWJvCAVCalZW0JrXU0E954419sPE=; b=XGr/rzFkf1pHzA2G2/ykP2+JET 94pd12J3hx3ceJFyhWO/nqivUA3kctWRJw8GZmDOlTFP1AWzvfhl74+YuY0jqrTE6vH+cBsMx/uLy +C4o9Q5OowPSBGYp4bOiK5n4dRNAgDrl4ZIBnBl51USU/EpqgCPqH+ommTRP5hjTLj4E=; X-Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from <andrew@lunn.ch>) id 1xEsll-009fsi-LK; Thu, 08 Oct 2026 20:23:05 +0200 X-Cc: Heiner Kallweit <hkallweit1@gmail.com>, Russell King <linux@armlinux.org.uk>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, David Daney <david.daney@cavium.com>, netdev@vger.kernel.org, linux-kernel@vger.kernel.org X-Precedence: bulk X-Mailing-List: netdev@vger.kernel.org X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-In-Reply-To: <20261008175612.2748920-1-vulab@iscas.ac.cn>