lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID:
 <SEYPR06MB513493FB37198295427938789D3E2@SEYPR06MB5134.apcprd06.prod.outlook.com>
Date: Wed, 11 Dec 2024 03:06:38 +0000
From: Jacky Chou <jacky_chou@...eedtech.com>
To: Simon Horman <horms@...nel.org>
CC: "andrew+netdev@...n.ch" <andrew+netdev@...n.ch>, "davem@...emloft.net"
	<davem@...emloft.net>, "edumazet@...gle.com" <edumazet@...gle.com>,
	"kuba@...nel.org" <kuba@...nel.org>, "pabeni@...hat.com" <pabeni@...hat.com>,
	"robh@...nel.org" <robh@...nel.org>, "krzk+dt@...nel.org"
	<krzk+dt@...nel.org>, "conor+dt@...nel.org" <conor+dt@...nel.org>,
	"p.zabel@...gutronix.de" <p.zabel@...gutronix.de>, "netdev@...r.kernel.org"
	<netdev@...r.kernel.org>, "devicetree@...r.kernel.org"
	<devicetree@...r.kernel.org>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>
Subject:
 回覆: [PATCH net-next v4 3/7] net: ftgmac100: Add reset toggling for Aspeed SOCs

Hi Smatch

Thank you for your reply.

> > +	struct reset_control *rst;
> >
> >  	/* AST2500/AST2600 RMII ref clock gate */
> >  	struct clk *rclk;
> > @@ -1979,6 +1981,22 @@ static int ftgmac100_probe(struct
> platform_device *pdev)
> >  				  priv->base + FTGMAC100_OFFSET_TM);
> >  	}
> >
> > +	priv->rst = devm_reset_control_get_optional_exclusive(priv->dev, NULL);
> > +	if (IS_ERR(priv->rst))
> > +		goto err_register_netdev;
> 
> Hi Jacky,
> 
> The goto on the line above will result in this function returning err.
> However, it seems that err is set to 0 here.
> And perhaps it should be set to PTR_ERR(priv->rst).
> 
> Flagged by Smatch.

Agree.
I will add that err is assigned by PTR_ERR(priv->rst) for error handling in next version.

priv->rst = devm_reset_control_get_optional_exclusive(priv->dev, NULL);
if (IS_ERR(priv->rst)) {
	err = PTR_ERR(priv->rst);
	goto err_register_netdev;
}

Otherwise, err may be zero when getting an error from devm_reset_control_get_Optional_exclusive().
Thank you for your kind reminder.

Thanks,
Jacky

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ