Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp79215pxb; Sun, 15 Aug 2021 23:55:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwYGZ5IrCj/XQni8YX+ajXK/3AOZUonyJ9MctxIaepBcbpNJsjMlPcyozntWgr0vnXAmQuT X-Received: by 2002:a17:906:404:: with SMTP id d4mr14585419eja.449.1629096934663; Sun, 15 Aug 2021 23:55:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629096934; cv=none; d=google.com; s=arc-20160816; b=kEgj7TOMl2xUgo1Bh0ehcld31XexHFBud+9fEu+WlvhSwCDz1YbpJmosJqqj1DTV6H ZK4LRGkFDV9N87aGUcxqhatEA00I37PQJqdmvCFv0JB1cJSiEMC9FKHZyC0L2Hx0pVpc HxZp221pMNcr1wNi/BWbLQQGjDNMxbDbGPNA9EDzsDLqWdEGCZPTs5EYNaT+cORCc1lT aheUyjMlKtmsEcmR//jjw/czQmPnweFLXweKKVKTSz68DRjGbEZ7LI7AX0czERJ/3Z0U RDL1/cnp8JHXFEFIPMZczX5R8+HQ00c0NFlwuN+mTymZp6Zl5wXPhkxHrdGhNxi5yb/e R3Lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:sender:dkim-signature; bh=cp2iIqkS3nq9qSvD8DNeoWJwVYTZyNF0KPecSRrnaDs=; b=wBOIFv5UObHzwo7kubM5mfgIxkQ9lWGDWaBBI2+lsf6rdIHplQL8wEr0/TBJyg7CO9 TtInzGrT0r0+1W7ZKiULAcB0hnYU6XIrqRZAazlM7t65AZGYcqXQED5NQg7vIpdZiGbk U0MBwmQDO9fdzvvf6+I+ZEODgMcvaGgL4g1t4/oYda1mSIsOJXJZamLPZd4e8Tww3eUz Tlza4I0v5gpU16EwJCCjhG5Y3iHZkpX0mWzcBVBn3LgMRVYpMLtOZD5/h36e/RTCP9/K zW4pNvGZ9tmIWPPTZg9jDU6hG6EfSYBfXzO0XCWfo987oPCzCwZiTvDmluLsJ2UElzOx ESXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kV37+Lml; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b18si9216833ejh.638.2021.08.15.23.55.11; Sun, 15 Aug 2021 23:55:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kV37+Lml; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233751AbhHPGxf (ORCPT + 99 others); Mon, 16 Aug 2021 02:53:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233712AbhHPGxc (ORCPT ); Mon, 16 Aug 2021 02:53:32 -0400 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC2ABC061764; Sun, 15 Aug 2021 23:53:01 -0700 (PDT) Received: by mail-ej1-x62d.google.com with SMTP id gr13so779861ejb.6; Sun, 15 Aug 2021 23:53:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=cp2iIqkS3nq9qSvD8DNeoWJwVYTZyNF0KPecSRrnaDs=; b=kV37+LmlDsuUDNmc70tAzK4kkxK/3n6A9iTjGvh2o5DYbAr8YGxD6P4ZD84i/HjRbq +US1vza9Q9UgZA2DwyiA6Gx1OIuRdBNiiF5NkuVT8IP4oc40gCphYV+212nOyXJKPnEl gzSciLC3FAI9hofzoyWDOUi52/tLdrUhUQzowMuM2VqLTqNzD4W8xk9noHvrbGA9eJ0d TG1PGIaaF2N7XwvIa39w6em231hfF0RcjrdBQy7ZJwc68bpmMOYrwQ2pxSsaYCuMCFOq 9OhcjCDdgoLbc6XrzIcRNiflbDhR5oh8nNToR6vljyvX9tIDy5on45QckbRdocBiJ8sU H0eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=cp2iIqkS3nq9qSvD8DNeoWJwVYTZyNF0KPecSRrnaDs=; b=kgHT1r8qxsh5B5nY/tRWX3p3P3+z22dJG7kNCUSSuIoKa3BjmPYsD42v2ifEWoMwnH GJ/Aj/8IfmREgzmU0MBwRf2Ceb91c/P3Qu8zTo5OszV1frRzcX28GS/lsBvm88OTnNTk MirtOGaUdnZELw60QKlBf5XsqXAOfHQgfqjB4y/DrF17o4pokgLLECd30jy6Poak5sgE XnyxTheD5zkS3roqL1e3cNCrDuPuDUuixJWWdXdjoQ5RwFWrxxDL/CvqqDey0dHhk0np Xk/c0KHc82c7k+dENHxRghXEnzy+RMfJCvAYGFIniqEwSSxq56lHRFWmZTWA8avuvo3A WTyQ== X-Gm-Message-State: AOAM532nE0UD5ft6odC2lcPWo9xVugbkaAO+3rMFaMhs7QLE9832yYMe TZaGgz99KYl68s8kDTd3+6meyzUj3JQ+cw== X-Received: by 2002:a17:906:e245:: with SMTP id gq5mr14432229ejb.121.1629096780234; Sun, 15 Aug 2021 23:53:00 -0700 (PDT) Received: from eldamar (host-82-55-38-10.retail.telecomitalia.it. [82.55.38.10]) by smtp.gmail.com with ESMTPSA id v12sm1305843ede.16.2021.08.15.23.52.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Aug 2021 23:52:59 -0700 (PDT) Sender: Salvatore Bonaccorso Date: Mon, 16 Aug 2021 08:52:58 +0200 From: Salvatore Bonaccorso To: Greg KH Cc: David Miller , tuba@ece.ufl.edu, netdev@vger.kernel.org, kuba@kernel.org, oneukum@suse.com, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Subject: Re: [PATCH v2] net: hso: do not call unregister if not registered Message-ID: References: <20201002114323.GA3296553@kroah.com> <20201003.170042.489590204097552946.davem@davemloft.net> <20201004071433.GA212114@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201004071433.GA212114@kroah.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Greg, Tuba, On Sun, Oct 04, 2020 at 09:14:33AM +0200, Greg KH wrote: > On Sat, Oct 03, 2020 at 05:00:42PM -0700, David Miller wrote: > > From: Greg KH > > Date: Fri, 2 Oct 2020 13:43:23 +0200 > > > > > @@ -2366,7 +2366,8 @@ static void hso_free_net_device(struct hso_device *hso_dev, bool bailout) > > > > > > remove_net_device(hso_net->parent); > > > > > > - if (hso_net->net) > > > + if (hso_net->net && > > > + hso_net->net->reg_state == NETREG_REGISTERED) > > > unregister_netdev(hso_net->net); > > > > > > /* start freeing */ > > > > I really want to get out of the habit of drivers testing the internal > > netdev registration state to make decisions. > > > > Instead, please track this internally. You know if you registered the > > device or not, therefore use that to control whether you try to > > unregister it or not. > > Fair enough. Tuba, do you want to fix this up in this way, or do you > recommend that someone else do it? Do I miss something, or did that possibly fall through the cracks? I was checking some open issues on a downstream distro side and found htat this thread did not got a follow-up. Regards, Salvatore