Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2470533pxk; Sun, 4 Oct 2020 00:15:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxVLxNCOPX2xGEYBn7H+jy7AJt1Wnd6JJIKkf+4aze8+ID+DefeRM0ngVY6bX162Gg6aNMI X-Received: by 2002:a17:907:20e6:: with SMTP id rh6mr9351587ejb.169.1601795757130; Sun, 04 Oct 2020 00:15:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601795757; cv=none; d=google.com; s=arc-20160816; b=pE7gVvHobFOzpsQiBy8B17TLaFFLy1Ryw81SUm7gxd4yE9HaQ4jf5v+EC8Hv8jABX7 oOxZwRitUAwh3vfrwTkvGPhU8c7EUU5+Q25pyYCy7yPJSXUlb6MNgShocFAfrNMDTTLp ad6qvP/mguzQY8vE1hrp4aHiVwWAnFMS6X2efFwFu3Ct8Mu0I1oFapdVEnFrLCIATuuV sqlDxWEmcDQ6TrS8bc1ZrIuMJPvx12gOSq5UqHDSq++0Upe8aaQjLn0nNWGOGjNJrLgI wCw4v2B5qHzkAkyfx7z5/GJqZsde0DnxoUoN6peohhvm0S4UWBLf0b72d4bE7dSl5RUq sBwQ== 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:dkim-signature; bh=7vKmqAsB2XE5LV4rxGm/VmtTqBR7o6nOixIJI08/6UY=; b=LFDqgQ/Vm+SK3Sr102h5W59MIyKpW1viqZNIplEKNb/FTGkH8jQNyRuaTehkDYIaA4 72lWnpP5yLMRpyAqN3qCPemsY7e6nRlIXxwEXbz/SJ2xBe15BTN0rccTgdYX3Em+LkxT Zgn8bdHsDAGYNAA3F3QyQEUAhA9XElclnoPsuUqalMJdDbiK3nBWtb25Q+NcTJ36o2tD wUGVVgjzZd/Zbx512Y7hlbHypVrwHll0G04kadz3+LTfhr4A3iKobdibotVhi4rlq9SU m+TaGVUxgyGDI05dwnse2HjLHGdvj7v/Bo5dM+2O9mrddEnLKZyOQWLCBdKoIKojH1ID YIcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jkWu5Xty; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id do17si4031693ejc.502.2020.10.04.00.15.34; Sun, 04 Oct 2020 00:15:57 -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=@kernel.org header.s=default header.b=jkWu5Xty; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725856AbgJDHOi (ORCPT + 99 others); Sun, 4 Oct 2020 03:14:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:53452 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725825AbgJDHOi (ORCPT ); Sun, 4 Oct 2020 03:14:38 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DA6F9206B5; Sun, 4 Oct 2020 07:14:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601795676; bh=nxfiwjn+39b/hJ9+GCFzDel9gA6L4vHMKGgDLhmoKww=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jkWu5Xty8iAAAQiFe3mrFwWXkRKi7AWVNKjc5qGmCO3CGZ7oYj2bgbJbhfYE0kGCl JExjhT0Ptekx2bLsH5qZwPT7VtVYpA5AFQ/IpyTGlJKcAYx4QrCiXuby/JzBevwWNP j8ZTiTenIx569OdFl14FRmNz+5pZ1hOzS3WUJ2Us= Date: Sun, 4 Oct 2020 09:14:33 +0200 From: Greg KH To: David Miller , tuba@ece.ufl.edu Cc: 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: <20201004071433.GA212114@kroah.com> References: <20201002114323.GA3296553@kroah.com> <20201003.170042.489590204097552946.davem@davemloft.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201003.170042.489590204097552946.davem@davemloft.net> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? thanks, greg k-h