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-next>] [day] [month] [year] [list]
Message-Id: <20230203132102.313314-1-alexander.stein@ew.tq-group.com>
Date:   Fri,  3 Feb 2023 14:21:02 +0100
From:   Alexander Stein <alexander.stein@...tq-group.com>
To:     Wei Fang <wei.fang@....com>, Shenwei Wang <shenwei.wang@....com>,
        Clark Wang <xiaoning.wang@....com>,
        "David S . Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>, Arnd Bergmann <arnd@...db.de>,
        Andrew Lunn <andrew@...n.ch>
Cc:     Alexander Stein <alexander.stein@...tq-group.com>,
        NXP Linux Team <linux-imx@....com>, netdev@...r.kernel.org
Subject: [PATCH 1/1] net: fec: Don't fail on missing optional phy-reset-gpios

The conversion to gpio descriptors accidentally removed the short return
if there is no 'phy-reset-gpios' property, leading to the error

fec 30be0000.ethernet: error -ENOENT: failed to get phy-reset-gpios

This is especially the case when the PHY reset GPIO is specified in
the PHY node itself.

Fixes: 468ba54bd616 ("fec: convert to gpio descriptor")
Signed-off-by: Alexander Stein <alexander.stein@...tq-group.com>
---
 drivers/net/ethernet/freescale/fec_main.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index 2716898e0b9b..1fddd7ec1118 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -4058,6 +4058,8 @@ static int fec_reset_phy(struct platform_device *pdev)
 
 	phy_reset = devm_gpiod_get(&pdev->dev, "phy-reset",
 			active_high ? GPIOD_OUT_HIGH : GPIOD_OUT_LOW);
+	if (PTR_ERR(phy_reset) == -ENOENT)
+		return 0;
 	if (IS_ERR(phy_reset))
 		return dev_err_probe(&pdev->dev, PTR_ERR(phy_reset),
 				     "failed to get phy-reset-gpios\n");
-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ