Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp84012pxb; Mon, 16 Aug 2021 00:03:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxmpad5f5oL/PhcioMdjNYIS05OGzPmLWXkOXqibns9TRSJZ/L6nSJyleGKIvOZ0RmtrzA1 X-Received: by 2002:a92:db06:: with SMTP id b6mr10737138iln.305.1629097433566; Mon, 16 Aug 2021 00:03:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629097433; cv=none; d=google.com; s=arc-20160816; b=El7jhqTz3b4r6/keKC/WYcsyNHx3nEFeDQJMPJWX9SeBU6d2F6ltPO0K7WJVQdXj7q uRyYcAiJUVaM49phhZVXMjNBZDB7KT2+c8WyBWdqOui6ZfpkVLhWlXCZ6p9rtfEF2Cdt I0Q9L8Pz7BYvfTFWwkGVJZuf/KSkBWtJQnx7stWtaqNGpGSYlkjiL2utT7HhSSeA0MUt Hs3lV+3G5hFEPBoxcUH7jDIUvQ4etFCoMOWUxmYHBNHpzHkwcFzbGybCwBqnSUXxAAlV thv5ip5V8sf3vtsKd3wmGRbZ/oZjgFAEZF4ZdDSFpmbBYgDzsjfwnuGrwGjU0geYbtad QBOA== 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=LTQX+YPvbWvnheG63yOHp/Fb/cxoJAd37nxTYOTvwbk=; b=pfVuAUBsMGqhS9ws32WraMBftNsC3YCS7Rp7KIKCDXp0028IiwOJnuWUzkYp1IjWeF HVRNKrXJoe0p+PnHs/X8NlRTqYZxpyaLcV84LHd0tSi8zZVpVavtZY916WKPhUATYf3O UBJ/F+C+9IH5S7sYqZqnUFgGwV6CNjGSIsPnSqeJN7SDLQEKuRAGRGz6IKF31VVuEHU3 DCIdqLv8XZMQuApijaPrnY0YnI/+OE++Cb3r/dXD12d4IytbRbMFNKAz1BEqczneeW36 KFg4n6ops6hyNeEMRsR8DzsbOeHTzqdwSVWN8YNeiNrnrWK74D7Dj9/VzXVoWMafoHOU KjlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ISbwARMF; 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=pass (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 e9si10914650ios.63.2021.08.16.00.03.41; Mon, 16 Aug 2021 00:03:53 -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=@linuxfoundation.org header.s=korg header.b=ISbwARMF; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233712AbhHPHDN (ORCPT + 99 others); Mon, 16 Aug 2021 03:03:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:57940 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233723AbhHPHDK (ORCPT ); Mon, 16 Aug 2021 03:03:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 83EC261A86; Mon, 16 Aug 2021 07:02:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1629097359; bh=NEhOhNn51b6BaxHNGueUbfM3PA9uRwYmLljxdcnbVZ4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ISbwARMFpUlx050yLFm9ANJgbNAyDab8u1K2UH2/KbiYEKGLl4FnqqlRePYPzto52 bNFtIsGXt610MnH8LHCdwjC4IENw4gN46HiTdbU04PVIY+Cxtb9lQVQyKxyiR7Dj8C ZYg8Ld/x5GW1zvWbaA2B6IH04yf2n26kvf2acObw= Date: Mon, 16 Aug 2021 09:02:36 +0200 From: Greg KH To: Salvatore Bonaccorso 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: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 16, 2021 at 08:52:58AM +0200, Salvatore Bonaccorso wrote: > 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. I did not see a follow-up patch :(