From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:6f8:1178:4:290:27ff:fe1d:cc33]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W4AvA-0003BU-RX for barebox@lists.infradead.org; Fri, 17 Jan 2014 15:01:21 +0000 From: Sascha Hauer Date: Fri, 17 Jan 2014 16:00:56 +0100 Message-Id: <1389970856-15904-1-git-send-email-s.hauer@pengutronix.de> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH] net: phy: Fix crash when no phy is found To: barebox@lists.infradead.org Signed-off-by: Sascha Hauer --- drivers/net/phy/phy.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 6ca1bb2..faa5c26 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -290,6 +290,11 @@ int phy_device_connect(struct eth_device *edev, struct mii_bus *bus, int addr, if (!IS_ERR(dev) && !dev->attached_dev) break; } + + if (IS_ERR(dev)) { + ret = PTR_ERR(dev); + goto fail; + } } if (dev->attached_dev) -- 1.8.5.2 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox