Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp827171ybe; Wed, 4 Sep 2019 08:19:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqyosoOUrCu/eqOXWeAY/sOYnpu4SlV51TmunJpjUgAsY4ajGwdFVUHX9zTv19udqYhThp7O X-Received: by 2002:a17:902:441:: with SMTP id 59mr42000417ple.62.1567610342961; Wed, 04 Sep 2019 08:19:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567610342; cv=none; d=google.com; s=arc-20160816; b=U/lZcjXDtUwbnc77pLVRZlrMqeUZuJCDXKIz7vgvTNboGCV6F0IOgNNfLWhFD1E7KX 8HTWTguxNqPYmOgvNIx9e/dYGZA+vMMlagGKKicEDglK/FGXZ4fe4303T+blEyneHaRN Qh8d1xof6iansOp6+BBCxIXRMvmTibCKBPfGR4HNSazamiln8H/4wRF5uToxx6Rhilxl Wq8X9u9IqfWKrmnZHJNan6GlTS/KjSuUK3RZgNKGI/s6+rpaKRgh7zqVNURH0577UYkk K2IBxEHOfSuVWwWLmEaFQalQE9TM+RcEv2D6PmOYJfmVxc24qPtCa99w9WeN6C4EZxbe uzGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:content-transfer-encoding :content-id:mime-version:subject:cc:to:references:in-reply-to:from :organization; bh=RoT09JwNp/oTYOf4Bt9jJd4pwVZn4BozLYl2uX3doZE=; b=n71WxDcpjEobJbIrrvndLGEeZH0lnzE8Y5ydq5DwIg1/B5dIx4RPk3M4U3UJ0E0aM1 GtqK/7NUOqL/sbr6sZrZ0VXZmxwQrcpXKfGKFpXTOmwujHJhSnjDGXNHl7kQvP1eAKml AjnMYpyGv5ooIb8Uxk6KMAAGYMgPan3z2gz9n+4s0O1n/55WTnYbjeDL4TMg20CxAJsK RP8LIGxBDHjP4V8NnqDC7t3kbk1i3jqpTYY7/DKMLXvKjyOadM5lDXW3BkiH4gMVjmnN lwvln6Numpz+PHjcORTFC8qnWCUGOGfMqbOcwtnHJCNh+lOD0N3OHxpIu+orHd4iuKBa 8yZA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u38si17604109pgn.79.2019.09.04.08.18.46; Wed, 04 Sep 2019 08:19:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731175AbfIDPRw convert rfc822-to-8bit (ORCPT + 99 others); Wed, 4 Sep 2019 11:17:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33346 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729635AbfIDPRw (ORCPT ); Wed, 4 Sep 2019 11:17:52 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 67C7710F23EC; Wed, 4 Sep 2019 15:17:51 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-120-255.rdu2.redhat.com [10.10.120.255]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2EC6560C44; Wed, 4 Sep 2019 15:17:46 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: References: To: Alan Stern Cc: dhowells@redhat.com, Guenter Roeck , viro@zeniv.linux.org.uk, Casey Schaufler , Stephen Smalley , Greg Kroah-Hartman , nicolas.dichtel@6wind.com, raven@themaw.net, Christian Brauner , keyrings@vger.kernel.org, linux-usb@vger.kernel.org, linux-security-module@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 08/11] usb: Add USB subsystem notifications [ver #7] MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1500.1567610266.1@warthog.procyon.org.uk> Content-Transfer-Encoding: 8BIT Date: Wed, 04 Sep 2019 16:17:46 +0100 Message-ID: <1501.1567610266@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.66]); Wed, 04 Sep 2019 15:17:52 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Alan Stern wrote: > > > Unfortunately, I don't know how to fix it and don't have much time to > > > investigate it right now - and it's something that can be added back later. > > > > The cause of your problem is quite simple: > > > > static int usbdev_notify(struct notifier_block *self, > > unsigned long action, void *dev) > > { > > switch (action) { > > case USB_DEVICE_ADD: > > + post_usb_device_notification(dev, NOTIFY_USB_DEVICE_ADD, 0); > > break; > > case USB_DEVICE_REMOVE: > > + post_usb_device_notification(dev, NOTIFY_USB_DEVICE_REMOVE, 0); > > + usbdev_remove(dev); > > + break; > > + case USB_BUS_ADD: > > + post_usb_bus_notification(dev, NOTIFY_USB_BUS_ADD, 0); > > + break; > > + case USB_BUS_REMOVE: > > + post_usb_bus_notification(dev, NOTIFY_USB_BUS_REMOVE, 0); > > usbdev_remove(dev); > > break; > > } > > > > The original code had usbdev_remove(dev) under the USB_DEVICE_REMOVE > > case. The patch mistakenly moves it, putting it under the > ------------------------------^^^^^ > > Sorry, I should have said "duplicates" it. Ah, thanks. I'd already removed the USB bus notifications, so I'll leave them out for now. David