🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #881

Re: [PATCH] net: mvmdio: fix clk reference leak in orion_mdio_probe()

#881
From: Andrew Lunn
Date: Thu, 08 Oct 2026 19:20
19 lines
6350 bytes
On Fri, Oct 09, 2026 at 12:53:28AM +0800, Haotian Zhang wrote:
> orion_mdio_probe() calls of_clk_get() with index ARRAY_SIZE(dev->clk)
> purely to test whether the device tree declares more clocks than the
> driver supports.  of_clk_get() takes a reference on the returned clk,
> but the return value is only checked with IS_ERR() and never released,
> so both the clk reference and the clk allocated by alloc_clk() are leaked
> whenever the DT node has more than four clocks.
> 
> Store the returned clk in a local variable and release it with clk_put()
> after emitting the warning.

net-next.


    Andrew

---
pw-bot: cr
Technical Details
Message-ID: <d751e352-8f67-40cf-97ba-89f40adb8a69@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-343235-linux-kernel-netdev=dewy.ru
References: <20261008165328.2702289-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-343235-linux-kernel-netdev=dewy.ru
From: andrew@lunn.ch (Andrew Lunn)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH] net: mvmdio: fix clk reference leak in orion_mdio_probe()
Date: Thu, 8 Oct 2026 21:20:43 +0200
Organization: Usenet Network
Message-ID: <d751e352-8f67-40cf-97ba-89f40adb8a69@lunn.ch>
References: <20261008165328.2702289-1-vulab@iscas.ac.cn>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: usenet.network;
	logging-data="952148"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:rP//MlsUe+9iIClRRNhWB3uO00Q= sha256:04uTYCoMQHBt2xPStHmap1SaIAtoBQ/julwAEEryxuU=
	sha1:PtF6+twLG0w5bqFqraiz+KcutuE= sha256:8cZ1ElwVsrtnRTezNQXNLnFZVywyrF5/5OYBO2Bju5A=
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 3B20D10F4E8; Thu,  8 Oct 2026 22:21:19 +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 2fgdqutzTO61;
	Thu,  8 Oct 2026 22:21:16 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-343235-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 2331810F487; Thu,  8 Oct 2026 22:21:12 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
	by tor.lore.kernel.org (Postfix) with ESMTP id 0F70C3199F; Thu,  8 Oct 2026 19:21:00 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id D77223CBE8F;
	Thu,  8 Oct 2026 19:20:54 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="MMtJ4nEe"
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 7082E3CB2DC;
	Thu,  8 Oct 2026 19:20:53 +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=1791487254; cv=none; b=CdVEMO5sy3YYeFKGD1layRjpPZ6z4FFDr5Bt8cC4ZmEtDJrHqsy7mW5oxFYi6laH5yPe2KLJ67shGOcUpzteejdkb+BseFlOtXpUCLsVLYmimlk3sk6VhRGgluV58KYLDTIdrwTu1vjZdVQs51HgTS6HxIn11EoGlmqwp3gpqpo=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1791487254; c=relaxed/simple;
	bh=Lr0YofJuvB/cxUVYTgtX2pzsLj7GIcMD5H+4H6pC/DY=;
	h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:
	 Content-Type:Content-Disposition:In-Reply-To; b=WufUV4J9x3NnjOjwdhqhULdAY4GUb2qyBfrJRkCmwsRnp5DWRVVNYdwlOFzm2dYGlkY9G/h5NMzkWAt559Nv1mS43CYIRqPFad3Z3y6HJAwVgddhsJ601lxUknpRPyqt/JkP8tLNgGMGhY5YtcTstPZxyIT8VzUCBXWa01H6/vA=
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=MMtJ4nEe; 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=Vw8k6LKBeC1Nrn51i6w9hRTe6YpUNnGX7Cuj7Kwd6OA=; b=MMtJ4nEeF047037huGqtilTYHh
	kXCbtNmbi/IbSzHxlOT8wiH4mHhWSxxkIsKsaFPQoE8Y4Sxh411/Q0sbbxZf9LASBKSAwuFmjn3av
	Ft25AZJXzKsbLGURP2lsRRhsZ9bSCwCzrjBRelZWjj/psJdlIaiY/EKINsd4MIjdogyw=;
X-Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2)
	(envelope-from <andrew@lunn.ch>)
	id 1xEtfX-009gHz-P9; Thu, 08 Oct 2026 21:20:43 +0200
X-Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Josua Mayer <josua@solid-run.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: <20261008165328.2702289-1-vulab@iscas.ac.cn>