Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752866AbdHUJpk (ORCPT ); Mon, 21 Aug 2017 05:45:40 -0400 Received: from mail-lf0-f42.google.com ([209.85.215.42]:37631 "EHLO mail-lf0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751895AbdHUJpi (ORCPT ); Mon, 21 Aug 2017 05:45:38 -0400 Subject: Re: [PATCH 2/2] net: phy: Don't use drv when it is NULL in phy_attached_print To: Romain Perier , 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> From: Sergei Shtylyov Message-ID: <5c7d444c-427f-7a4d-8603-02bd4dc4b909@cogentembedded.com> Date: Mon, 21 Aug 2017 12:45:36 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20170821075235.28473-3-romain.perier@collabora.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 775 Lines: 28 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. > Signed-off-by: Romain Perier [...] MBR, Sergei