Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756405Ab3HZHne (ORCPT ); Mon, 26 Aug 2013 03:43:34 -0400 Received: from eusmtp01.atmel.com ([212.144.249.242]:54586 "EHLO eusmtp01.atmel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752449Ab3HZHnd (ORCPT ); Mon, 26 Aug 2013 03:43:33 -0400 Message-ID: <521B073C.3070204@atmel.com> Date: Mon, 26 Aug 2013 09:43:56 +0200 From: Nicolas Ferre Organization: atmel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130803 Thunderbird/17.0.8 MIME-Version: 1.0 To: Boris BREZILLON CC: , , Subject: Re: [PATCH] net/cadence/macb: fix kernel Oops if no PHY were discovered during probe References: <1377372065-8938-1-git-send-email-b.brezillon@overkiz.com> In-Reply-To: <1377372065-8938-1-git-send-email-b.brezillon@overkiz.com> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.161.30.18] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1313 Lines: 39 On 24/08/2013 21:21, Boris BREZILLON : > Test the presence of a PHY device before printing attached PHY > informations. > > Signed-off-by: Boris BREZILLON Acked-by: Nicolas Ferre > --- > drivers/net/ethernet/cadence/macb.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c > index e866608..fd3b67f 100644 > --- a/drivers/net/ethernet/cadence/macb.c > +++ b/drivers/net/ethernet/cadence/macb.c > @@ -1868,8 +1868,10 @@ static int __init macb_probe(struct platform_device *pdev) > dev->irq, dev->dev_addr); > > phydev = bp->phy_dev; > - netdev_info(dev, "attached PHY driver [%s] (mii_bus:phy_addr=%s, irq=%d)\n", > - phydev->drv->name, dev_name(&phydev->dev), phydev->irq); > + if (phydev) > + netdev_info(dev, "attached PHY driver [%s] (mii_bus:phy_addr=%s, irq=%d)\n", > + phydev->drv->name, dev_name(&phydev->dev), > + phydev->irq); > > return 0; > > -- Nicolas Ferre -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/