From mboxrd@z Thu Jan 1 00:00:00 1970 From: Florian Fainelli Subject: Re: [PATCH net-next 1/2] net: linkwatch: add check for netdevice being present to linkwatch_do_dev Date: Wed, 19 Sep 2018 17:03:02 -0700 Message-ID: <6e4ae96c-f879-d545-6e66-0fc9b01ac56d@gmail.com> References: <11beeaa9-57d5-e641-9486-f2ba202d0998@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: "netdev@vger.kernel.org" , Geert Uytterhoeven To: Heiner Kallweit , Andrew Lunn , David Miller Return-path: Received: from mail-wm1-f68.google.com ([209.85.128.68]:54901 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726000AbeITFni (ORCPT ); Thu, 20 Sep 2018 01:43:38 -0400 Received: by mail-wm1-f68.google.com with SMTP id c14-v6so8000112wmb.4 for ; Wed, 19 Sep 2018 17:03:14 -0700 (PDT) In-Reply-To: <11beeaa9-57d5-e641-9486-f2ba202d0998@gmail.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 09/18/2018 12:55 PM, Heiner Kallweit wrote: > When bringing down the netdevice (incl. detaching it) and calling > netif_carrier_off directly or indirectly the latter triggers an > asynchronous linkwatch event. > This linkwatch event eventually may fail to access chip registers in > the ndo_get_stats/ndo_get_stats64 callback because the device isn't > accessible any longer, see call trace in [0]. > > To prevent this scenario don't check for IFF_UP only, but also make > sure that the netdevice is present. > > [0] https://lists.openwall.net/netdev/2018/03/15/62 > > Signed-off-by: Heiner Kallweit Reviewed-by: Florian Fainelli Thanks Heiner! -- Florian