Received: by 10.223.185.116 with SMTP id b49csp1055106wrg; Fri, 23 Feb 2018 11:05:18 -0800 (PST) X-Google-Smtp-Source: AH8x2253nwjZcPxU/WPTB6Kv4CQWm7804md85m6xA50hDl7IuccIa/UEXcM4PiBm3/9wvSBmA6YU X-Received: by 10.101.82.139 with SMTP id y11mr2202560pgp.68.1519412717941; Fri, 23 Feb 2018 11:05:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519412717; cv=none; d=google.com; s=arc-20160816; b=fzAeIGJru3HvNsbHPAedqKIG+3fNGRRXainu10vrooDyt0ivHT9sRAS3IJl7Ksa7fs zvRess3cSdqKJcBGb2ah4UU1iA0SW6Av7vtBCc/D6gsd5PaXAB7L11zBwtZtArtziFoJ ldcURXbW/Ce98DFC1Rhkgn1T8Yd7H/BPre51dbVhkE0MfJRHVyrsZcrAw4IA8pRBKBnx sFpfYaEsnSXeC9Taw/W+2RguEm6cJ6To4J6KJq7MLmSlhoo0nD4IzeqN1BiojhRwhggc Jk8sAWeDaXxcXSNOIjvKdnAsJn7iQHCkt6Pvtqs9ofE3DMytxuZyRV0pliM8gLu2OdxF nUVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=qH5y7EcZN16NOhYzdGghET4RwtKQkdsqLCAvcRYn6W8=; b=KywoKmUG1s8rw45L/KpPr18TqI1z3Fl3bjS4cyQ1jxt8cPfyZm9Nvnn89SiiKWW+mI xNxj4F+FS9WHgtj4RAQtse7oBddIv00Lsrmj8bKC/Ft69yq2RJyl3dtcEpMIxZc/7xos sakyF+rTJSg6cHFhqh6q/iZokYfeeW5pHD+tt4417sWuyPpYNusYMbzQ2xs0/o+8HpBO y0g21jmS4F3lYKZRqSRaR1Ja3D+ZO8r+p8RUNMCtINgPg/cZhyktUB3fI+EVPeK4xJ0n 1hs5Pd9GwKyqQdDSp0df+qq27zfgkbG1Q0SsM34HpdgxesQB4FFz6e4KfnY6wHRsjg+j fcdg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j20si2233525pff.85.2018.02.23.11.05.03; Fri, 23 Feb 2018 11:05:17 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965645AbeBWS6m (ORCPT + 99 others); Fri, 23 Feb 2018 13:58:42 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:50640 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965285AbeBWS6i (ORCPT ); Fri, 23 Feb 2018 13:58:38 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id E28DE114F; Fri, 23 Feb 2018 18:58:37 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zhengjun Xing , Mathias Nyman Subject: [PATCH 4.15 39/45] xhci: xhci debugfs device nodes werent removed after device plugged out Date: Fri, 23 Feb 2018 19:29:18 +0100 Message-Id: <20180223170721.532274481@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180223170715.197760019@linuxfoundation.org> References: <20180223170715.197760019@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Zhengjun Xing commit 8c5a93ebf7ac56d47f879b3c7c2f8c83b40c2cdb upstream. There is a bug after plugged out USB device, the device and its ep00 nodes are still kept, we need to remove the nodes in xhci_free_dev when USB device is plugged out. Fixes: 052f71e25a7e ("xhci: Fix xhci debugfs NULL pointer dereference in resume from hibernate") Cc: # v4.15 Signed-off-by: Zhengjun Xing Signed-off-by: Mathias Nyman Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/xhci.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -3552,12 +3552,10 @@ static void xhci_free_dev(struct usb_hcd virt_dev->eps[i].ep_state &= ~EP_STOP_CMD_PENDING; del_timer_sync(&virt_dev->eps[i].stop_cmd_timer); } - + xhci_debugfs_remove_slot(xhci, udev->slot_id); ret = xhci_disable_slot(xhci, udev->slot_id); - if (ret) { - xhci_debugfs_remove_slot(xhci, udev->slot_id); + if (ret) xhci_free_virt_device(xhci, udev->slot_id); - } } int xhci_disable_slot(struct xhci_hcd *xhci, u32 slot_id)