Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753412AbdHULqN (ORCPT ); Mon, 21 Aug 2017 07:46:13 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:39471 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751941AbdHULqL (ORCPT ); Mon, 21 Aug 2017 07:46:11 -0400 Subject: Re: [PATCH 2/2] net: phy: Don't use drv when it is NULL in phy_attached_print To: Sergei Shtylyov , Giuseppe Cavallaro , Alexandre Torgue , Andrew Lunn , Florian Fainelli Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20170821075235.28473-1-romain.perier@collabora.com> <20170821075235.28473-3-romain.perier@collabora.com> <5c7d444c-427f-7a4d-8603-02bd4dc4b909@cogentembedded.com> From: Romain Perier Message-ID: <8a710dd3-0c84-5e45-28e4-e56be5883e68@collabora.com> Date: Mon, 21 Aug 2017 13:46:07 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <5c7d444c-427f-7a4d-8603-02bd4dc4b909@cogentembedded.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 803 Lines: 32 Hello, Le 21/08/2017 à 11:45, Sergei Shtylyov a écrit : > Hello! > > On 8/21/2017 10:52 AM, Romain Perier wrote: > >> Currently, if this logging function is used prior the phy driver is >> binded to the phy device (that is usually done from .ndo_open), > > s/binded/bound/. > >> 'phydev->drv' might be NULL, resulting in a kernel crash. That is >> typically the case in the stmmac driver, info about the phy is displayed >> during the registration of the MDIO bus, and then genphy driver is >> binded > > Likewise. > >> to this phydev when .ndo_open is called. >> >> This commit fixes the issue by using the right genphy driver, when >> phydev->drv is NULL. >> >> Fixes: commit fbca164776e4 ("net: stmmac: Use the right logging functi") > > "Commit" not needed here. Fixed, thanks Romain